XML::Parser cannot work on DTD as DTD is not an XML document.
XML::Parser cannot even validate XML document against DTD, because it's based on expat, which is non-validating XML parser.
I cannot imagine how one can create 'template XML document' from DTD.
DTD specifies rules for document composition, but if tag <foo> can contain tags <foobar> and <foofoo>, will you create <foo><foobar> or <foo><foofoo> (or <foo><foobar/><foofoo/>)in this 'template' document?
I can imagine GUI-based tool that will help you in authoring XML by supplying you with valid tags in your current context,
but if you are looking for something like this, you should at least specify OS/platform for such a tool.
BTW: If someaone know of such tool for Linux/Solaris, I will appreciate an URL.