title: Change the default XML xmlns namespace value in .NET
body: <p>I need to get a list of files from a VS project file. csproj file is XML file, so I use linq to xml to parse it. The problem is in default namespace of csproj file, it is declared like: </p>
  
  <blockquote>
    <p>xmlns="http://schemas.microsoft.com/developer/msbuild/2003"</p>
  </blockquote>
  
  <p>Here is the code I use to find "Compile" elements in a csproj file:</p>
  
  <pre><code>XmlReader reader = XmlReader.Create(projectFilePath);
  XDocument doc = XDocument.Load(reader);
  XmlNameTable nameTable = reader.NameTable;
  XmlNamespaceManager nsManager = new XmlNamespaceManager(nameTable);
  XNamespace nms = doc.Root.GetDefaultNamespace();
  nsManager.AddNamespace("", nms.NamespaceName);
  List&lt;XElement&gt; csFiles = new List&lt;XElement&gt;(doc.Root.XPathSelectElements("//Compile", nsManager));
  </code></pre>
  
  <p><code>doc.Root.XPathSelectElements</code> returns an empty list. </p>
  
  <p><code>nsManager.DefaultNamespace</code> has value "http://schemas.microsoft.com/developer/msbuild/2003".
  But <code>nsManager.LookupNamespace("xmlns")</code> returns default XML namespace: "http://www.w3.org/2000/xmlns/".</p>
  
  <p>How to change the xmlns namespace value?</p>