I\'m trying to create an XML document that looks something like this...
The DOM isn't an interface for building document type definitions, which is why you won't find methods for adding things like entity declarations to the internal subset. If you must inline it instead of using an external subset, you're going to have to provide it as a complete string and load it up accordingly.
$xml = <<<'XML'
]>
XML;
$dom = new DOMDocument();
$dom->loadXML($xml);
echo $dom->saveXML();
]>