title: Remove Duplicate Namespaces
body: <p>So, I am trying to write out this:</p>
  
  <pre><code>&lt;w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  ...
      &lt;w:rPr xmlns="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
          &lt;w:shadow /&gt;
          &lt;p2:u p2:val="dottedHeavy" p2:color="00CCFF" xmlns:p2="http://schemas.openxmlformats.org/wordprocessingml/2006/main" /&gt;
          &lt;p2:effect p2:val="lights" xmlns:p2="http://schemas.openxmlformats.org/wordprocessingml/2006/main" /&gt;
          &lt;p3:caps p3:val="true" xmlns:p3="http://schemas.openxmlformats.org/wordprocessingml/2006/main" /&gt;
      &lt;/w:rPr&gt;
  ...
  &lt;/w:document&gt;
  </code></pre>
  
  <p>As this</p>
  
  <pre><code>&lt;w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
  ...
      &lt;w:rPr&gt;
          &lt;w:caps/&gt;
          &lt;w:shadow/&gt;
          &lt;w:u w:color="00CCFF" w:val="dottedHeavy"/&gt;
          &lt;w:effect w:val="lights"/&gt;
      &lt;/w:rPr&gt;
  ...
  &lt;/w:document&gt;
  </code></pre>
  
  <p>using <code>xdoc.Save(file, SaveOptions.OmitDuplicateNamespaces)</code>, but the resulting file still has duplicate namespaces. Since that isn't working, how does one remove duplicate name-spaces from an XDocument? I have tried using <code>XmlReader</code>, <code>XmlWriter</code>, and <code>XmlDocument</code> with their equivalent options, and it still doesn't work.</p>
  
  <p>P.S. in-case you are wondering, that is docx data with <code>...</code> representing excluded data</p>