Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
If the element in question has a minOccurs equal to zero or is nillable, then it must be wrapped in a JAXBElement, since it may be null.
If, however, this is not the case, then JAXB will deliver the unwrapped object representing the element - a org.apache.xerces.dom.ElementNSImpl.
An instance of the ElementNSImpl class represents an arbitrary XML element with namespace support.
Thanks Ivan, In my case it minOccurs is zero so it is wrapped as JAXBElement but the SOAP request/response complains of in compatible with org.apache.xerces.dom.ElementNSImpl.
I also read from the specification that if the lax=true ...
"If true, when an element matches a property marked with XmlAnyElement is known to JAXBContext (for example, there's a class with XmlRootElement that has the same tag name, or there's XmlElementDecl that has the same tag name), the unmarshaller will eagerly unmarshal this element to the JAXB object, instead of unmarshalling it to DOM. Additionally, if the element is unknown but it has a known xsi:type, the unmarshaller eagerly unmarshals the element to a JAXBElement, with the unknown element name and the JAXBElement value is set to an instance of the JAXB mapping of the known xsi:type.
As a result, after the unmarshalling, the property can become heterogeneous; it can have both DOM nodes and some JAXB objects at the same time. "