When generating XML from XmlDocument in .NET, a blank xmlns
attribute appears the first time an element without an associated namespace is inserted; ho
If the
element in your sample XML didn't have the xmlns
default namespace declaration on it, then it would be in the whatever:name-space-1.0
namespace rather than being in no namespace. If that's what you want, you need to create the element in that namespace:
xml.CreateElement("loner", "whatever:name-space-1.0")
If you want the
element to be in no namespace, then the XML that's been produced is exactly what you need, and you shouldn't worry about the xmlns
attribute that's been added automatically for you.