title: XmlDocument ignore xmlns
body: <p>I have XHTML file which starts with:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  </code></pre>
  
  <p>I load it:</p>
  
  <pre><code>XmlDocument xml = new XmlDocument();
  StringReader sr = new StringReader(html);
  XmlTextReader xmltr = new XmlTextReader(sr);
  xmltr.Namespaces = false;
  xml.Load(xmltr);
  </code></pre>
  
  <p>When I call <code>xml.InnerXml</code> I always got <code>The 'xmlns' attribute is bound to the reserved namespace 'http://www.w3.org/2000/xmlns/'.</code> exception and can't access inner xml of my XmlDocument. How to get rid of xmlns during load?</p>
  
  <p>SOLUTION IS:</p>
  
  <pre><code>XmlNode xmln = xml.SelectSingleNode("//html");
  if (xmln != null)
      ((XmlElement)xmln).RemoveAttribute("xmlns");
  </code></pre>