title: XmlNode.ReplaceChild is complaining that the node I'm trying to remove is not a child despite the fact that I got to the node via ParentNode
body: <p>I have a simple function that's designed to copy a section of an xml document to another.  I want to replace one node with the other so ReplaceChild seems like the logical choice.  I keep getting the error 'The reference node is not a child of this node.' though.  That seems odd since I found that node by asking for the parent in the first place.  Any idea what I'm doing wrong?</p>
  
  <pre><code>    private static void KeepSection(XmlDocument newDoc, XmlDocument currentDoc, XmlNamespaceManager nsmgr, string path)
      {
          XmlNode section = currentDoc.SelectSingleNode(path, nsmgr);
          XmlNode newSection = newDoc.SelectSingleNode(path, nsmgr);
          if (newSection != null &amp;&amp; section != null)
          {
              XmlNode parent = newSection.ParentNode;
              parent.ReplaceChild(newSection, newDoc.ImportNode(section, true));
          }
      }
  </code></pre>