I have an XML document. For example
< xml version="1.0" encoding="utf-8" >
<hello xmlns="duracellko:hello" xmlns:xs="http://www.w3.org/2001/XMLSchema"></hello>
I would like to remove xmlns and xmlns:xs attributes. I loaded this xml into XmlDocument object and then removes all attributes from DocumentElement. But when I save the XmlDocument, then there is still xmlns attribute in hello element. Can you help me how to remove namespace declarations from XML document.
Thank you
Rasto

Removing xmlns attributes
Pinei
I used overridden WriteStartElement and WriteStartAttribute and it worked.. thx.
puso
Jolo
Namespace is part element name. You have to copy elements to remove them. You can use XSLT (see http://wiki.apache.org/cocoon/RemoveNamespaces) or tweak XmlTextWriter's WriteStartElement and WirteStartAttribute.
Aquilax