Characters in character data content

The ampersand (&) and left angle bracket (<) are not permitted in character data content of XML elements, since these characters mark the beginning of entity references and XML tags, respectively. There may be occasions in which a developer needs to include these in XFDL character content (for example, e-mail URLs). In such cases, the developer can include the ampersand and left angle bracket in a few different ways, such as using the XML entities &amp; and &lt; or simply wrapping the character content in a CDATA section. The character sequence ]]>, which normally cannot appear in character data content, appears in a CDATA section as the delimiter token that marks the end of a CDATA section. When the sequence ]]> appears as character data, then the right angle bracket (>), if necessary, should be expressed with an entity reference such as &gt;.

These rules apply to all XFDL elements, but they are often used when constructing e-mail URLs, which use the ampersand to indicate additional parameters. For example:

   <url><![CDATA[mailto:everyone@world.earth?body=Hello]]></url>