title: Creating XML Elements without namespace declarations
body: <p>I attempting to add a new "PropertyGroup" element to the following XML file</p>
  
  <pre><code>&lt;Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"&gt;
    &lt;PropertyGroup&gt;
      &lt;ProjectGuid&gt;{00AA7ECA-95A0-0000-0000-AD4D2E056BFE}&lt;/ProjectGuid&gt;
      &lt;OutputType&gt;Library&lt;/OutputType&gt;
      &lt;AppDesignerFolder&gt;Properties&lt;/AppDesignerFolder&gt;
      &lt;RootNamespace&gt;testnS&lt;/RootNamespace&gt;
      &lt;AssemblyName&gt;testname&lt;/AssemblyName&gt;
      &lt;PluginId&gt;4B84E5C0-EC2B-4C0C-8B8E-3FAEB09F74C6&lt;/PluginId&gt;
    &lt;/PropertyGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>The code I am using is as follows (note there is other logic that has been removed) :</p>
  
  <pre><code>        XmlTextReader reader = new XmlTextReader(filename);
          XmlDocument doc = new XmlDocument();
  
          doc.Load(reader);
          reader.Close();
  
          XmlNamespaceManager ns = new XmlNamespaceManager(doc.NameTable);
          ns.AddNamespace("x", "http://schemas.microsoft.com/developer/msbuild/2003");
  
          XmlElement root = doc.DocumentElement;
          XmlNode refNode = root.SelectSingleNode("x:Project", ns);
  
          root.SelectSingleNode("Project", ns);
  
          XmlElement newElement = doc.CreateElement("PropertyGroup", "http://schemas.microsoft.com/developer/msbuild/2003");
          newElement.InnerXml = "&lt;value&gt;test&lt;/value&gt;";
          root.InsertAfter(newElement, refNode);
          doc.Save(filename);
  </code></pre>
  
  <p>This yields the following new element in the XML document :</p>
  
  <pre><code>&lt;PropertyGroup&gt;
    &lt;value xmlns=""&gt;test&lt;/value&gt;
  &lt;/PropertyGroup&gt;
  </code></pre>
  
  <p>How do I get rid of the namespace declaration on the  element?</p>