DTD stands for Document Type Definition, which defines the structure and legal elements and attributes of an XML document. It specifies what elements can appear, their order, and their relationships. DTDs provide a way to validate XML documents against a defined structure, though they have been largely superseded by XML Schema.