title: how to edit XML data within SOAP Request using C#?
body: <p>I would like to edit xml data for one element with in SOAP request in order to send unique SOAP requests. </p>
  
  <p>Following is the example request</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:web="http://webservice/"&gt;
     &lt;soapenv:Header/&gt;
     &lt;soapenv:Body&gt;
        &lt;web:ca&gt;
           &lt;type1&gt;
              &lt;ad&gt;2013-07-19&lt;/ad&gt;
              &lt;name&gt;abcd 13071502&lt;/name&gt;
              &lt;taker&gt;
                 &lt;taker&gt;TEST&lt;/taker&gt;
                 &lt;emailAddress&gt;test@test.com&lt;/emailAddress&gt;
                 &lt;name&gt;nameTest&lt;/name&gt;
                 &lt;phoneNo&gt;007007007&lt;/phoneNo&gt;
                 &lt;takerUid&gt;1234&lt;/takerUid&gt;
              &lt;/taker&gt;
           &lt;/type1&gt;
           &lt;type2&gt;4&lt;/type2&gt;
           &lt;type3&gt;peace&lt;/type3&gt;
           &lt;type4&gt;test&lt;/type4&gt;
        &lt;/web:ca&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>I would like to change "name" element value from "abcd 13071502" to "abcd ".  I was able to extract data from "name" element and edit the value by using following code in C#</p>
  
  <pre><code>System.Xml.XmlTextReader xr = new XmlTextReader(@filePath);
  while (xr.Read())
  {
  if (xr.LocalName == "name")
      {
          xr.Read();
          currentNameValue = xr.Value;
          int cnvLen = currentNameValue.Length;
          string cnvWOdate = currentNameValue.Substring(0, cnvLen-8);
          string newNameValue = cnvWOdate+currTimeDate;
          break;
      }
  }
  </code></pre>
  
  <p>However, I couldn't figure out how to edit the value and save the file. Any help would be appreciated. Thank you.</p>