I am wondering if it is possible to have JAXB not to create Java object for XML elements that serve as wrappers. For example, for XML of the following structure
Worth mentioning, if the content is a list of instead of a single instance:
...
then you can use the @XmlElementWrapper annotation:
@XmlRootElement(name = "root") public class Root { @XmlElementWrapper(name = "wrapper") @XmlElement(name = "entity") private List entity; static class Entity { } }