title: C# Find and replace data inside XML tag
body: <p><strong>Xml File :</strong> </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;
  &lt;ResDoc&gt;
  &lt;Summary&gt;
  My name is Magesh
  &lt;/Summary&gt;
  &lt;/ResDoc&gt;
  </code></pre>
  
  <p>How to find the data "Magesh" inside Summary tag and replace it as "GivenName".</p>
  
  <p>A c# code to load XML file, find and replace.</p>
  
  <p>I have tried to loading xml file using XMLDocument, find and replace. But it is not expected.</p>
  
  <pre><code>xdoc = new XmlDocument {PreserveWhitespace = true};
  xdoc.LoadXml(taggedresume);
  string Name1 = "Magesh";
  
  foreach (XmlNode var in xdoc.SelectSingleNode("//ResDoc/summary"))
  {
   var.InnerXml.Replace(Name1, "GivenName");                   
  }
  </code></pre>