The DTD is a file in which the structured documents rules are defined - for instance, the DTD defines the names of the elements (tags) that can be used in a document, the element hierarchy, the kind of content that can be contained in an element, and the elements' attributes.