title: Xml namespace and C# csproj
body: <p>I'm using powershell 2.0 to edit a lot of csproj files. One of the requirements for editing is to add new PropertyGroup with different condition (Please check the example below)</p>
  
  <pre><code>&lt;PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'My-New-Env|AnyCPU'"&gt;
  </code></pre>
  
  <p>The problem is that powershell added the empty xmlns for all new PropertyGroup tags that I have added.</p>
  
  <p>Eg:</p>
  
  <pre><code>&lt;PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'My-New-Env|AnyCPU'" xmlns=""&gt;
  </code></pre>
  
  <p><strong>Is there any way to add new xml node without having any namespace?</strong></p>
  
  <p>I tried removing the namespace attribute by using the code below before adding new PropertyGroup but it didn't work. (meaning that attribute is not actually removed and I can still see the empty namespace after adding new node.)</p>
  
  <pre><code>$content = [xml](gc $_.FullName);     
  
      Write-Host "Reading "$_.FullName -foregroundcolor yellow;
  
      $project = $content.Project;
  
      $content.Project.RemoveAttribute("xmlns");
  </code></pre>
  
  <p><strong>Edit:</strong> I'm following this post for adding new node.</p>
  
  <p><a href="https://stackoverflow.com/questions/9991688/how-to-add-new-propertygroup-to-csproj-from-powershell">How to add new PropertyGroup to csproj from powershell</a></p>
  
  <p>Example:</p>
  
  <pre><code>$content = [xml](gc $_.FullName); 
    $importNode = $content.ImportNode($configs.DocumentElement, $true) 
    $project = $content.Project;
    $project
    $project.AppendChild($importNode);
    # $content.Save($_.FullName);
  </code></pre>