title: how to add xmlns attribute to an existing xml document
body: <p>I have existing xml document. </p>
  
  <p>e.g</p>
  
  <pre><code>&lt;Test&gt;
    &lt;A /&gt;
  &lt;/Test&gt;
  </code></pre>
  
  <p>I load this xml into XDocument. I need to add attribute xmlns to this document and save it with this attribute.</p>
  
  <pre><code>var xml = new XDocument.Load("c:\\filePath.xml");
  </code></pre>
  
  <p>When I'm trying this: </p>
  
  <pre><code>xml.Root.SetAttributeValue("xmlns", "http://namespaceuri");
  </code></pre>
  
  <p>I'm getting exception:</p>
  
  <pre><code>System.Xml.XmlException: The prefix '' cannot be redefined from 'http://namespaceuri' to  within the same start element tag.
  </code></pre>
  
  <p>thanks</p>