I usually do the following:
XmlDocument document = new XmlDocument();
document.LoadXml("htts://example.com/documento.xml");
File.WriteAllText(@"C:\ruta\mixml.xml", document.OuterXml);
and when opening the file, the result is that I get the xml in a single line:
<?xml version="1.0" encoding="utf-8"?><item><data><url>url01</url><files><file>file01</file><file>file02</file></files></data></item>
There are no spaces between lines, making it difficult to read when dealing with very long documents.
Using Json.NET there is an option to format a json with Formatting.Indented
string json = JsonConvert.SerializeObject(object, Formatting.Indented);
Is there an option to format an XML Indentation?
<?xml version="1.0" encoding="utf-8"?>
<item>
<data>
<url>url01</url>
<files>
<file>file01</file>
<file>file02</file>
</files>
</data>
</item>