This one is the best solution i've found to save the xml "doc" well formatted to file "data.xml":
XmlDocument doc = new XmlDocument();
doc.LoadXml("<item><name>wrench</name></item>");
using (XmlTextWriter writer = new XmlTextWriter("data.xml", null)) {
writer.Formatting = Formatting.Indented;
doc.Save(writer);
}