i have created a xml file using c# but the main problem is that it is not indented
i have used xmldocument.preserverwhitespace=true;
i have created a xml file using c# but the main problem is that it is not indented
i have used xmldocument.preserverwhitespace=true;
Strongly suggest you switch over to the new XML document model, based on XDocument. You can use LINQ to XML on it, and it's much easier to create, alter, and search XML than it ever wasin the old XMLDocument model. The new XDocument model can cut your code size by over half.
If you are using an XmlTextWriter, you can set the Formatting property :
XmlTextWriter xmlWriter = new XmlTextWriter("c:\ouputfile.xml", System.Text.Encoding.UTF8);
xmlWriter.Formatting = Formatting.Indented;