Suppose i have an XML like this:
<host name="myHost">
<service>
<type>TYPE1</type>
<field1>The content of field 1</field1>
</service>
<service>
<type>TYPE2</type>
<field2>The content of field 2</field2>
</service>
</host>
There is a way (with JAXB / XStream) to say "when you find an element in service with TYPE1 use a POJO that is Type1 / When you find an element in service with TYPE2 use a POJO that is Type2 ?
I will need this to use a generic tag and the type of this tag will make the difference about the POJO class to use in Unmarshalling process