DTD stands for Document Type Definition and allows an XML document to specify requirements to be considered valid. A DTD defines allowable elements, attributes, and relationships between elements in an XML document. Validation ensures an XML document matches the DTD specifications. DTDs can be embedded locally in an XML file or referenced externally from a URI.