When an entity reference is encountered in the XML message, both the expanded form and the original entity name are stored in the syntax element tree. The name of the entity is stored as the value of the EntityReferenceStart and EntityReferenceEnd syntax elements, and any syntax elements between contain the entity expansion.
Examples of the XML entity references in an XML document and in tree structure form are shown below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!DOCTYPE example [ <!ENTITY entityName "eValue"> ]> <example>Test: &entityName;</example>
The XML declaration and the document type declaration are not shown here. Refer to The XML declaration and XML document type declaration for details of those sections of the syntax element tree.