External entities offer a mechanism for dividing your document up into logical chunks. Rather than authoring a monolithic document, a book with 10 chapters, for example, you can store each chapter in a separate file and use external entities to "source in" the 10 chapters.
Because external entities in different documents can refer to the same files on your file system, external entities provide an opportunity to implement reuse. Reuse of small, discrete components (figures, legal boilerplate, warning messages) is fairly easy to manage. Implementing reuse on a large scale requires an entity management system which XML, by itself, does not provide.
External entity declarations come in two forms. If the external entity contains XML text, the declaration has the following form:
<!ENTITY entityname [PUBLIC "public-identifier"] SYSTEM "system-identifier">
The system identifier must point to an instance of a resource via a URI, most commonly a simple filename. The public identifier, if supplied, may be used by an XML system to generate an alternate URI (this provides a handy level of indirection on systems that support public identifiers).
An external entity that incorporates chap1.xml into your document might be declared like this:
<!ENTITY chap1 SYSTEM "chap1.xml">
Despite the growing trend to store everything in XML, there are some legacy systems that still store data in non-XML formats. Graphics are sometimes stored in odd formats like PNG and GIF, for example ;-).
External entities that refer to these files must declare that data they contain is not XML. They accomplish this by indicating the format of the external entity in a notation:
<!ENTITY entityname[PUBLIC "public-identifier"] SYSTEM "system-identifier"notation>