You can inline a DTD (i.e. include it directly in the XML in a !DOCTYPE declaration).
But of course an XML parser does not need a DTD to parse
well-formed XML.
It only needs a DTD or schema to "validate" the XML (compare the structure and content of a document with the DTD or schema). Not all XML parsers have this capability.
David