There is a common misconception that JAXB requires an XML Schema. This is understandable since JAXB offers the ability to derive Java classes from an XML schema, and generate XML schemas from annotated Java classes. In reality the JAXB annotations are used to map XML to objects, and although not part of the JAXB specification, the XJC tool offers the ability to generate Java classes from a DTD. In this post we will use JAXB to interact with XML that corresponds to the Apache log4j DTD.