A DTD (Document Type Definition) defines the rules for what elements and attributes may contain and for what attributes an element may have.
There are complicated "text" semantics for processing DTD modules and expanding entity references.
But, they aren't that hard to read:
<!ELEMENT img EMPTY> <!ATTLIST img src CDATA #REQUIRED > <!ELEMENT p (#PCDATA|img|b|i)* > <!ELEMENT b (#PCDATA) > <!ELEMENT i (#PCDATA) >