How to programmatically indent an xml file?

caeanis

Active member
Joined
Sep 6, 2006
Messages
26
I have file that Im writing to using the appendchild function and then save. It works, but the problem is that it doesnt insert line item and indent the tag properly, each childnode gets written on the same line one after another. Is there a function or class that can indent the child nodes automatically besides doing it via xmltextreader?
 
If you are just trying to read the XML file yourself, drop it into the VS editor. VS will automatically indent everything and format the XML so that it is more human readable.
 
Back
Top