What is the best what to handle carriage returns in xml formatting with xml?
<myxml>
<mydata>
</mydata>
</myxml>
<myxml><mydata></mydata></myxml>
What is the best what to handle carriage returns in xml formatting with xml?
<myxml>
<mydata>
</mydata>
</myxml>
<myxml><mydata></mydata></myxml>
It doesn't make any difference.
If you want the XML to be smaller, don't add newlines.
If you want it to be human-readable, add newlines and indentation.
LINQ to XML will format the XML with tabs and newlines by default; to prevent this, call element.ToString(SaveOptions.DisableFormatting)