SGML and XML define the rules and procedures to specify the vocabulary and the syntax of a markup language in a formal DTD. Such a DTD is a formal description of, e.g., names for all elements, names and default values for their attributes, rules about how elements can nest, and names for re-usable pieces of data (entities). The TEI created not just one DTD, but a collection of tag sets (also known as elements sets or DTD fragments) which combine to one or more DTDs. Some of these tagsets are required, some are basic, and some are optional. The users of the TEI can select the convenient tagsets for inclusion in their DTD(s).
(Vanhoutte 2004,§ 5.1)