Is it possible to marshal a JAXB annotated class instance as its superclass (which is also a JAXB annotated class)?
@XmlAccessorType(XmlAcce
I haven't checked it, but I'd try first:
new JAXBElement(new QName("BenmaningType"),
BenManingTYPE.class, moreDetailedBenmaningTYPEInstance)
If you're generating classes from an XML Schema, check also the copyable plugin. You could the copy data from an instance of MoreDetailedBenamningTYPE
to the instance BenmaningTYPE
and marshal that.
There are more possibilities, but they're a bit more complex.