title: Null returned when selecting a node in XML document
body: <p>New to XML.  I have a 3rd party webservice that supplies an XML document that I have to update the element values and pass back.   The core issue issue is I get an NullReferenceException error when calling the node.RemoveAll() method in the code below.  I'm calling the RemoveAll() method because each element has the xsi:nil attribute when it is supplied to me, and if I don't remove it before updating the element value, the XML won't validate by the webservice.</p>
  
  <p>The XML document supplied by the 3rd party webservice is as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-16"?&gt;
  &lt;TaskData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schema.sample.com/application/1/520800B"&gt;
    &lt;Global&gt;
      &lt;RequestInfo xmlns="http://schema.sample.com/application/1/Types"&gt;
        &lt;Requestor xsi:nil="true" /&gt;
        &lt;Date_init xsi:nil="true" /&gt;
        &lt;Shipto xsi:nil="true" /&gt;
        &lt;Customer xsi:nil="true" /&gt;
        &lt;Contact xsi:nil="true" /&gt;
        &lt;Requestor_Email xsi:nil="true" /&gt;      
      &lt;/RequestInfo&gt;    
     &lt;/Global&gt;
    &lt;/TaskData&gt;
  </code></pre>
  
  <p>Other solutions I've seen have used the XmlNamespaceManager, but I haven't been able to make it work.  This xml document has a namespace specified for the TaskData element, and  a different namespace for the RequestInfo element.  I tried specifying the XmlNamespaceManager variable for each namespace, but got the same results....hovering over the nsmgr variable while in break mode reveals that the "children could not be evaluated" and that the DefaultNamespace property is an empty string.  </p>
  
  <pre><code>Public Sub testxml()
  
      Dim doc As New XmlDocument
      doc.Load("c:\temp\sample.xml")
  
      Dim nsmgr As XmlNamespaceManager = New XmlNamespaceManager(doc.NameTable)
      nsmgr.AddNamespace("s", "http://schema.sample.com/application/1/520800B")
  
      Dim node As XmlNode = doc.SelectSingleNode("s:Requestor", nsmgr)
      node.RemoveAll()
      node.InnerText = "Your Name Goes Here"
  
      doc.Save("c:\temp\sample.xml")
  
  End Sub
  </code></pre>