Getting the position of all game objects with the same tag

Hi !

So, I have a 2D scene which I intend to save in XML using the XML Serializer and was planning who to save and load it.

What I want to do now (away from XML Serializer, in C#) is to get the positions of all game objects in the scene tagged, for example, GrassTile.

Also, I want to delete all the game objects tagged, also for example, SandTile.

How can I do that ?

Thanks in Advance

Use GameObject.FindGameObjectsWithTag to get an array of the GameObjects. loop through the array to either access their transform.positions individually, or declare a seperate Vector3 array and put the positions in there.
Same goes for deleting GameObjects: Loop through the array and delete each element.