title: Generate java classes from xsd with jaxb from a choice
body: <p>I use maven with jaxb to make classes out from a schema. This schema has the following choice:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;tns:choice minOccurs="1" maxOccurs="unbounded"&gt;
    &lt;tns:element name="video_track" type="tcore:TTrack" minOccurs="1" maxOccurs="1"/&gt;
    &lt;tns:element name="audio_track" type="tcore:TTrack" minOccurs="1" maxOccurs="1"/&gt;
  &lt;/tns:choice&gt;
  </code></pre>
  
  <p>The meening is, we want a list with <code>x</code> <code>audiotracks</code> and/or <code>x</code> <code>videotracks</code>. We need at least one of an audio or a video track!</p>
  
  <p>When I generate classes with this choice I get the following code:</p>
  
  <pre class="lang-java prettyprint-override"><code>@XmlElementRefs({
      @XmlElementRef(name = "audio_track", type = JAXBElement.class),
      @XmlElementRef(name = "video_track", type = JAXBElement.class)
  })
  protected List&lt;JAXBElement&lt;TTrack&gt;&gt; videoTrackOrAudioTrack;
  </code></pre>
  
  <p>This is not what we want. I think I loose informations because with the list of <code>TTracks</code> I don't know if this is a video or an audio. </p>
  
  <p>So what am I doing wrong here?</p>
  
  <p>In maven I use org.jvnet.jaxb2.maven2 version 0.8.3</p>