using System;
using System.IO;
using System.Text;
using System.Linq;
using System.Xml.Linq;
using System.Xml;
using System.Collections;
using System.Collections.Generic;
public class MainClass
{
public static void Main()
{
XDocument doc = new XDocument(
new XElement("Root",
new XElement("Child", "content")
)
);
StringBuilder sb1 = new StringBuilder();
using (StringWriter sr1 = new StringWriter(sb1))
{
doc.Save(sr1, SaveOptions.None);
Console.WriteLine(sb1.ToString());
}
StringBuilder sb2 = new StringBuilder();
using (StringWriter sr2 = new StringWriter(sb2))
{
doc.Save(sr2, SaveOptions.DisableFormatting);
Console.WriteLine(sb2.ToString());
}
}
}