The special characters for quote ("), apostrophe ('), less-than (<), greater-than (>), and ampersand (&) are used for punctuation in XML, and are represented with predefined entities: ", ', <, >, and &. Notice that the semicolon is part of the entity.You cannot use "<" or "&" in attributes or elements, as the following series of examples demonstrates.
<?xml version="1.0" encoding="utf-8"?>
<root>
<text>
These are predefine entities in xml: " < > & '
</text>
</root>
HTML has many other predefined entities, for example for a "non breaking space" or © for "copyright symbol":
http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
In order to use these entities, users can either use the corresponding Unicode hexadecimal value, or can actually define them using a DOCTYPE declaration.
For example, to define and © use:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Html [
<!ENTITY nbsp " ">
<!ENTITY copy "©">
]>
<root>
<text>
This text is separated by non breaking spaces: Mary had a little lamb.
</text>
<text>
This is the copyright symbol : ©
</text>
</root>
The same result would be obtained by using the hexadecimal notation:
<?xml version="1.0" encoding="utf-8"?>
<root>
<text>
This text is separated by non breaking spaces: Mary had a little lamb.
</text>
<text>
This is the copyright symbol : ©
</text>
</root>