This example demonstrates one way of formatting a string containing XML data using the XmlTextWriter. After loading the XML string into a DOM structure, the WriteTo() method of the XmlDocument is called to run the XML through the writer which will indent the different nodes appropriately.
|