The CDATA Tag
The Problem: Illegal Characters
When writing your XML documents, you must be aware that it is possible to confuse a parser, or even break your document, by including illegal characters.
For example, the following document would cause a problem:
<example>The symbol < denotes "less than"</example>
In this case, the XML parser sees the less than symbol in the text as an opening XML tag.
The Solution: CDATA
To include special characters, or preserve special formatting, you can use a CDATA tag.
<example><![CDATA[The symbol < denotes "less than"]]></example>
Using special characters without CDATA
However, if you want to use a special character in your XML (say for example in an attribute value where no CDATA exists), you can do so using its HTML character entity references.
So, to insert the ampersand symbol '&', you use:
And in XML:
<title txt='Name & Surname'>
For a list of all the HTML character entity references, click here.