in reply to Generate XMLs from a master XML or DTD
The W3C has a Perl script that will convert a DTD to XSD. http://www.w3.org/2000/04/schema_hack/
From that XSD you could easily use XML::XPath to do parse the elements and attributes listed in the XSD and produce XML from them.
In Section
Seekers of Perl Wisdom