In XML, an entity is a symbolic portrayal of information. With this type of representation, a lot of text can be replaced with an entity symbol. So if a portion of text is used repeatedly, say as an introduction, an entity symbol can be used in its place. Entities are created in the Document Type Definitions. Once they have been created in the DTD files, they can be referenced. Here is the syntax for creating your own XML entities. The syntax of an XML entity is shown in the example below.
Example: <!ENTITY entity_name “This is the message I am repeating”>
This is a very handy item. Entities can be used for the following:
• Things that are used a lot such as introductions, signatures, etc.
• Things that may change often. If a document is relatively static but a few items that are used throughout the document change frequently, using an entity will allow you to make a single change rather than several.
• If you are using complex ASCII characters that are not normally found on the keyboard such as © and ®.