DTD (Document Type Definition) defines the structure and the legal elements and attributes of an XML document.
It ensures that the XML document adheres to a predefined format and structure, enabling validation and consistent data exchange.
It does not deal with accessing or querying data but with defining its grammar.