I am stuck. I have an XML file that I am using Linq to edit. This particular XML file has an ampersand (&) in the text of a Tag. I am editing other parts of this string, but the '&' should not be touched. However, when I go to write my XML to disk, the '&' is replaced with '&' I understand that ampersands are illegal characters in XML and that is why this happens, but this particular file has to have it. It is not my file, so I can't help that fact.
XElement root = XElement.Load(localXMLPath);
var myElement= root.Element("System").Element("Math");
myElement.Value = = "Object1&Object2";
Output of myElement tag is always "Object1&Object2"
Hope that explains the issue and I hope there is a workaround other than writing it to disk and then using a text editor to remove the "amp;". Thanks.