title: C# - Xml manipulation using XmlDocument
body: <p>In C#, how do I replace a node in an xml with another node using XmlDocument.</p>
  
  <p>For E.g, consider the following xml file.</p>
  
  <pre><code>&lt;Products&gt;
    &lt;Product ProdID="1"&gt;
      &lt;Data&gt;abc&lt;/Data&gt;
    &lt;/Product&gt;
    &lt;Product ProdID="2"&gt;
      &lt;Data&gt;def&lt;/Data&gt;
    &lt;/Product&gt;
  &lt;/Products&gt;
  </code></pre>
  
  <p>Let us say I need to replace </p>
  
  <pre><code>  &lt;Product ProdID="2"&gt;
      &lt;Data&gt;def&lt;/Data&gt;
    &lt;/Product&gt;
  </code></pre>
  
  <p>with a new node</p>
  
  <pre><code>  &lt;Product ProdID="2"&gt;
      &lt;Data&gt;xyz&lt;/Data&gt;
    &lt;/Product&gt;
  </code></pre>