my old ANT file:
<target name="compile.schema">
<xjc removeOldOutput="no" readonly="yes" header="true"
stackSize="2mb" extension="true" classpath="${project.classpath}"
destdir="${xjc.target}">
<schema dir="${basedir}/resources/schema" includes="**/*.xsd" />
<produces dir="${xjc.target}" includes="**/**/*.class" />
</xjc>
</target>
I am not sure how it performs with DTD, but in schema you can use
annotations of "JAXB
Customization"..
if you can change your DTD to a XSD schema, perhaps I can help more...