2.1. Customizing Java packages
The JAXB specification provides a <jaxb:schemaBindings> customization so that you can control which namespace goes to which package. See the example below:
You can do this as an internal customization (in which case you put this in <xs:annotation><xs:appinfo> under place it right under the <xs:schema> element), or do this as an external customization, like this:
<bindings xmlns="http://java.sun.com/xml/ns/jaxb" version="2.1">
2.1.1. Tip: get rid of the org.w3._2001.xmlschema package
Under some rare circumstances, XJC will generate some Java classes into a package called org.w3._2001.xmlschema. This happens when XJC decides that it needs some Java artifacts for the XML Schema built-in namespace of http://www.w3.org/2001/XMLSchema.
Since this package name is most often problematic, you can rename this by simply saving the following text in an .xsd file and submitting it to XJC along with the other schemas you have:
This is bit tricky, but the idea is that since you can define a schema for one namespace in multiple schema documents, this makes XJC think that this schema is a part of the built-in "XML Schema for XML Schema".