XmlDocument OuterXml pretty printed

I have an XmlDocument and I want the contents (OuterXml) to be pretty printable. How can i do this?

Yours faithfully

+3
source share
1 answer

Assuming I get it right

using System.Xml.Linq;
XDocument xDoc = XDocument.Load(@".....\test.xml");
string xDocString = xDoc.ToString(SaveOptions.None);
+1
source

Source: https://habr.com/ru/post/1736989/


All Articles