I am using XmlWriter.Create()
to get a writer instance then write the XML, but the result has the <?xml version="1.0" encoding="utf-16" ?>
, how do I tell my xml writer do not produce it?
Use XmlWriterSettings.OmitXmlDeclaration
.
Don't forget to set XmlWriterSettings.ConformanceLevel
to ConformanceLevel.Fragment
.