A Document-Type Declaration (DTD) in XML is a set of markup declarations that defines the structure and the legal elements and attributes of an XML document. It serves as a blueprint for the document, specifying the rules that govern how the document's content is structured, ensuring that the XML data adheres to a defined format.
### Components of a DTD
A DTD can be defined in two ways: **internal** and **external**.
1. **Internal DTD:**
-