[[Document Type Definition]] ([[DTD]]) is a set of rules and guidelines that define the structure, elements, and attributes of an [[XML]] (eXtensible Markup Language) document. It specifies the allowed tags, their hierarchy, attributes, and data types in an XML document. DTDs are used to validate and enforce consistency in the structure and content of XML documents. They can be defined inline within an XML document or as a separate external file. DTDs support both element-based validation and attribute-based validation.