Replacing or removing characters in XmlDocument
//Replace or remove characters from the XmlDocument
private void ReplaceCharsInXml(XmlDocument xmlDoc, string toReplace, string replaceWith){
String xmlString = GetXmlString(xmlDoc);
xmlString = xmlString.Replace(toReplace, replaceWith);
xmlDoc.LoadXml(xmlString);
}
private string GetXmlString(XmlDocument xmlDoc){
StringWriter sw = new StringWriter();
XmlTextWriter xw = new XmlTextWriter(sw);
xmlDoc.WriteTo(xw);
return sw.ToString();
}