I have to process xml data in C#, however, sometimes there is an illegal XML character present. For example this XML code will not parse as it is invalid:
<xml>Another way to write a heart is <3</xml>
The XML parser will throw an error because it is not valid, which makes sense. Although, I don't seem to find a way to replace that only one "<" to "& lt;" so that the parser will receive:
<xml>Another way to write a heart is <3</xml>
Footnote: it can occure in any node in the xml which can be pretty large itself and like I said before, it happens not all the time...
Is there a function tthat can handle this?