Salve,
prima di tutto vi faccio i complimenti per il sito. E' da tanto che seguo questo sito usufruendo spesso delle guide e del vostro forum ma questa e' la prima volta che scrivo, e per questo mi scuso in anticipo se commettero' qualche errore.

Cerco di descrivere i mio problema.

Per la mia tesi mi ritrovo a dover creare un servizio java che crei a partire da dei dati estratti da un DB un XML, in particolare un CDA (Clinical Data Architecture).
Come prima cosa,seguendo vostra guide, ho creato le mie classi java a partire dall'.xsd, risolvendo anche qualche "errore" tramite un file di binding esterno.
Sino a qui tutto piu' o meno liscio.
A questo ho provato a realizzare il mio XML effettuando il Marshalling delle mie classi e qui il PROBLEMA, non riuscivo a selezionare determinati attributi delle mie classi a causa di una traduzione "strana" dei <xs:choice> dell'XML.
Estraggo un pezzo di codice per farvi un esempio

codice:
     
   <xs:complexType name="EN" mixed="true">
      <xs:complexContent>
         <xs:extension base="ANY">
            <xs:sequence>
               <xs:choice minOccurs="0" maxOccurs="unbounded">
                  <xs:element name="delimiter" type="en.delimiter"/>
                  <xs:element name="family" type="en.family"/>
                  <xs:element name="given" type="en.given"/>
                  <xs:element name="prefix" type="en.prefix"/>
                  <xs:element name="suffix" type="en.suffix"/>
               </xs:choice>
               <xs:element name="validTime" minOccurs="0" maxOccurs="1" type="IVL_TS">
               </xs:element>
            </xs:sequence>
            <xs:attribute name="use" use="optional" type="set_EntityNameUse">
            </xs:attribute>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>
Questa e' la classe derivata:

codice:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "EN", propOrder = {
    "content"
})
@XmlSeeAlso({
    ON.class,
    PN.class,
    TN.class
})
public class EN {


    @XmlElementRefs({
        @XmlElementRef(name = "delimiter", namespace = "urn:hl7-org:v3", type = JAXBElement.class, required = false),
        @XmlElementRef(name = "prefix", namespace = "urn:hl7-org:v3", type = JAXBElement.class, required = false),
        @XmlElementRef(name = "family", namespace = "urn:hl7-org:v3", type = JAXBElement.class, required = false),
        @XmlElementRef(name = "validTime", namespace = "urn:hl7-org:v3", type = JAXBElement.class, required = false),
        @XmlElementRef(name = "suffix", namespace = "urn:hl7-org:v3", type = JAXBElement.class, required = false),
        @XmlElementRef(name = "given", namespace = "urn:hl7-org:v3", type = JAXBElement.class, required = false)
    })
    @XmlMixed
    protected List<Serializable> content;
    @XmlAttribute(name = "use")
    protected List<String> use;



     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the content property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getContent().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link JAXBElement }{@code <}{@link EnDelimiter }{@code >}
     * {@link JAXBElement }{@code <}{@link EnPrefix }{@code >}
     * {@link JAXBElement }{@code <}{@link EnFamily }{@code >}
     * {@link JAXBElement }{@code <}{@link IVLTS }{@code >}
     * {@link JAXBElement }{@code <}{@link EnSuffix }{@code >}
     * {@link JAXBElement }{@code <}{@link EnGiven }{@code >}
     * {@link String }
     * 
     * 
     */
    public List<Serializable> getContent() {
        if (content == null) {
            content = new ArrayList<Serializable>();
        }
        return this.content;
    }


    /**
     * Gets the value of the use property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the use property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getUse().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link String }
     * 
     * 
     */
    public List<String> getUse() {
        if (use == null) {
            use = new ArrayList<String>();
        }
        return this.use;
Nel momento in cui provo a settare un elemento come "Given" o "Prefix" non riesco in quanto il metodo "getContent" accetta solo elementi Serializable e utilizzando "EnGiven" come suggerito dai commenti mi da un errore di casting.

A questo punto ho pensato di imporre la traduzione dei choice come singoli attributi tramite un codice di binding simile
codice:
    
<xs:annotation>
<xs:appinfo>
<jaxb:globalBindings
choiceContentProperty="true" <!-- bindingStyle="modelGroupBinding" -->
</xs:appinfo>
</xs:annotation>
Il risultato e' che il "choiceContentProperty" viene completamente ignorato, ed effettivamente leggendo la guida ufficiale questo e' corretto in quanto se non viene settato il "bindingStyle" su "modelGroupBinding" (che di default e' impostato come "elementBinding") e' proprio quello che deve fare.
Per concludere se provo a impostare il "bindingStyle" la rispsota e' un errore del tipo
"Attribute 'bindingStyle' is not allowed to appear in element 'jxb:globalBindings' "

Chiedo scusa se sono stato terribilmente prolisso nella spiegazione ma, come si sara' capito, non sono molto esperto e per spiegare il mio problema ho ritenuto farvi una panoramica generale della situazione.
Spero qualcuno mi risponda, in qualsiasi caso vi ringrazio in anticipo.
Saluti,
Luigi