I'm creating an XML file this way:
XmlDocument xFile = new XmlDocument();
xFile.InnerXml = XMLStringBuilder.ToString();
The stringbuilder which is used in the InnerXml step has certain character replacements dones:
& to &
' to '
" to "
Now, the problem is, when the xml document gets saved, the ' is written saved as ' and even " is saved as ". Only, & stays as it is.
I don't know why the replaced characters are turning back to their originals... this is totally not desired.
Why is this happening and how do I counter this?