To parse, or not to parse: that is the problem when your XML element values have characters that would otherwise be interpreted by an XML parser as syntax. However, we can use a special XML wrapper around our potentially dangerous text to solve this problem.
All the data in an XML document is initially considered PCDATA, or parsed character data. When interpreting a XML file, a parser will build the nodes by looking for a
<element> tag to start an element, and a
</element> to end the same element. In short, a parser is looking for the less than sign (<) to parse the text following it as an element name and attributes or the close of an element. After a element definition or closure finished, signified by the greater than sign (>), the parser will continue to look for another element and, if inside an existing element, the close of an element.
<![CDATA[ data ]]> tag will cause an XML parser to skip parsing that section of data, and thus ignore any special characters/syntax inside.
Now the question of to parse or not to parse is in your control. Choose wisely!