How can I remove the banner comment when writing XML data

The LxWriterSettings class has a WriteBannerComment property, setting this value to false will omit the banner comment from the top of the XML document.

For example:
MyElementClass elmCls = ...;
LxWriterSettings lxs = new LxWriterSettings { WriteBannerComment = false };
            
using (XmlWriter writer = XmlWriter.Create("MyXmlFile.xml"))
{
    serializer.Serialize(writer, elmCls, lxs);
}

Note: The banner comment can not be turned off in Trial or Community mode.