I am creating an XmlDocument in code and then using XmlTextWriter via
doc.WriteTo(xwriter) to output the result to a text box. I have a root
element that defines a default namespace. However, the sub-elements are
created without any namespaces like so:
XmlElement elem = doc.CreateElement("Foo");
root.AppendChild(elem);
but in the output I get this:
<?xml version="1.0" encoding="utf-8"?>
<Root xmlns="http://tempuri.org">
<Foo xmlns="" />
</Root>
How can I get rid of the ' xmlns="" ' attribute on the Foo element?
--
Keith