You can customize the xml output via the XmlWriterSettings.
You didn't include any code, but you can set the XmlWriterSettings when you create the XmlWriter. You can also just use something like:
var myXmlWriter = new XmlWriterSettings { Indent = true };