I would like to implement a program in Java in order to take as input a DTD file
and output an XML instance file based on the DTD.

That means that I have to parse and analyze in Java the DTD file.
Is there any API available online that defines methods for analyzing
the structure and the elements in the DTD file?

thanks