I am using a XMLWriter to create a basic XML, the XML file has one element that everything is in, for the sake of explaining it lets say this is just people then inside that there needs to be multiple elements inside of it, lets call them person then inside of them we have elements called names.
So it would look like this
<?xml version="1.0" encoding="utf-8"?>
<people>
<person>
<name>Name1</name>
</person>
<person>
<name>Name2</name>
</person>
<person>
<name>Name3</name>
</person>
</people>
But when I go to write a new person it will just come out like this (its just overwriting it):
<?xml version="1.0" encoding="utf-8"?>
<people>
<person>
<name>Name5</name>
</person>
</people>
I am using this to write each person element…
writer.WriteStartElement("person");
writer.WriteElementString(keys[i], values[i]);
writer.WriteEndElement();
Any way to stop it overwriting?
If you want to try LinqToXml