title: parsing vcxproj with System.Xml.XmlDocument
body: <p>I'm trying to parse a vcxproj file using powershell (actually with .NET class System.Xml.XmlDocument). The problem seems to be somehow related with the xmlns attribute of the root element - see example xml file below (extract of original xml)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    &lt;ItemGroup Label="ProjectConfigurations"&gt;
      &lt;ProjectConfiguration Include="Debug|Win32"&gt;
        &lt;Configuration&gt;Debug&lt;/Configuration&gt;
        &lt;Platform&gt;Win32&lt;/Platform&gt;
      &lt;/ProjectConfiguration&gt;
      &lt;ProjectConfiguration Include="Release|Win32"&gt;
        &lt;Configuration&gt;Release&lt;/Configuration&gt;
        &lt;Platform&gt;Win32&lt;/Platform&gt;
      &lt;/ProjectConfiguration&gt;
    &lt;/ItemGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>With powershell I open the xml file and want to select some nodes. But this actually does not return any node.</p>
  
  <pre><code>[System.Xml.XmlDocument] $xml = new-object System.Xml.XmlDocument
  $xml.Load("/path/to/xml/file")
  $nodes = $xml.SelectNodes("//ProjectConfiguration")
  </code></pre>
  
  <p>I already tried to add a namespace manager, but that didn't help:</p>
  
  <pre><code>[System.Xml.XmlDocument] $xml = new-object System.Xml.XmlDocument
  $xml.Load("/path/to/xml/file")
  $mgr=new-object System.Xml.XmlNamespaceManager($xml.Psbase.NameTable)
  $mgr.AddNamespace("gr",$xml.configuration.psbase.NamespaceURI)
  $nodes = $xml.SelectNodes("//ProjectConfiguration")
  </code></pre>
  
  <p>If I remove the xmlns attribute of the root element, everything works fine. </p>
  
  <p>Regards,
  Johannes</p>