Take a look at this:
Creating XML Trees in C# (LINQ to XML)[
^]
It uses XElement class to generate a XML file.
This code will generate an output like this one.
XElement address = new XElement("Address",
new XElement("Street1", "123 Main St"),
new XElement("City", "Mercer Island"),
new XElement("State", "WA"),
new XElement("Postal", "68042")
);
Console.WriteLine(address);
Output
<Address>
<Street1>123 Main St</Street1>
<City>Mercer Island</City>
<State>WA</State>
<Postal>68042</Postal>
</Address>
The nice thing with XElement is that you just build more and more nodes on it.
And when you are done, call .Save("filename.xml");