Is there an easy way to get DataContractSerializer to spit out formatted XML rather then one long string? I don\'t want to change the tags or content in any way, just have it ad
As bendewey says, XmlWriterSettings is what you need - e.g. something like
var ds = new DataContractSerializer(typeof(Foo));
var settings = new XmlWriterSettings { Indent = true };
using (var w = XmlWriter.Create("fooOutput.xml", settings))
ds.WriteObject(w, someFoos);