A Document Type Definition (DTD) file defines the element types and attributes in an XML file. A DTD file also provides some constraints on the XML file structure. A DTD file does not contain any data or element datatypes.
The following figure shows elements and attributes in a DTD file: