Serializing WITHOUT xmlns
No problem - just pass an empty string as the default namespace to the XML serializer:
XmlSerializer newSerializer =
new XmlSerializer(typeOfT, "");
Unfortunately, there's no easy constructor overload if you really need to define the XmlAttributeOverrides
and the default namespace - so either you can skip the XmlAttributeOverrides
and use that constructor I mentioned, or you need to use the one that defines all possible parameters (including XmlAttributeOverrides and default XML namespaces - and a few more).
A working solution, for the record!
var ns = new XmlSerializerNamespaces();
ns.Add("", "");
var serializer = new XmlSerializer(yourType);
serializer.Serialize(xmlTextWriter, someObject, ns);