After changing your XML, doc.OuterXml will have the updated the String.
XmlDocument doc = new XmlDocument();
doc.LoadXml(stringXML);
var fnode = doc.GetElementsByTagName("feature")[0];
var fval = fnode.Attributes["name"].Value;
if (fval == "IMAGING_SERVICES")
{
var servcnode = doc.GetElementsByTagName("service")[0];
var namenode = servcnode.Attributes["name"].Value;
if (namenode == "PRINTING")
{
doc.InnerXml.Replace(namenode, "IMAGING_OPTIONS");
}
}
String newXmlString = doc.OuterXml;
The newXmlString will have the updated XML.
Do you want to save the doc too?
Then you can reload the doc with the new XmlString :
doc.LoadXml(newXmlString);