XML Document Type Declaration commonly known as DTD is a way to describe precisely the XML language. DTDs check the validity of, structure and vocabulary of an XML document against the grammatical rules of the appropriate XML language. A DTD defines the structure and the legal elements and attributes of an XML document.