if you have the whole xml file as a string, you can replace what you need:
string oldStr = @"http://Server1.extranet.abc/server1webdev/rest/services/ABC/ABC_Base/MapServer"; string newStr = @"http://Server2.extranet.abc/server1webdev/rest/services/ABC/ABC_Base/MapServer "; doc.Replace(oldStr, newStr);
but usually, if you want to change the tag value in xml, I can offer an example, and you put it in your xml:
XDocument doc = XDocument.Load("D:\\tst.xml"); foreach (XElement cell in doc.Element("Actions").Elements("Action")) { if (cell.Element("ActionDate").Value == oldStr) { cell.Element("ActionDate").Value = newStr; } } doc.Save("D:\\tst.xml");
source share