I understand how to create a new xml document but I've not seen any documentation on how to assign it a DTD before saving to file. Can anybody give me a SHORT php example of this? Assume the following and fill in the code needed where the comment is:

   $doc = domxml_new_doc("1.0");
   // need to set <!DOCTYPE codes SYSTEM "codes.dtd"> here
   $codes = $doc->create_element("codes");
   $codes = $doc->append_child($codes);
   $code1 = $doc->create_element("code");
   $code1->setAttribute("value", "one");
   $code1 = $codes->append_child($code1);
   $code2 = $doc->create_element("code");
   $code2->setAttribute("value", "two");
   $code2 = $codes->append_child($code2);

Thanks in advance for your assistance.