Hi Urs
How about this - this will give you a String representation of your XML
document, but with formatting.
Dim d As New Xml.XmlDocument
d.LoadXml("<root><child>Text</child></root>")
Dim sw As New IO.StringWriter
Dim xw As New Xml.XmlTextWriter(sw)
xw.Formatting = Xml.Formatting.Indented
d.Save(xw)
xw.Close()
MessageBox.Show(sw.ToString())
sw.Close()
HTH
Nigel Armstrong
"Urs Vogel" wrote:
Hi
When using the XmlDocument.OuterXml property after adding some nodes and
attributes, it returns the entire document correctly, but it's actually all
on one line. How can I format the document that it becomes readable by
humans, with CRLFs and Tabs?
Thanks for any hints. Urs