title: JAXB List of Choice
body: <p>I have following schema</p>
  
  <pre><code>&lt;complexType name="BookShelf"&gt;
     &lt;sequence&gt;
        &lt;element name="newBook" type="string" minOccurs="0" maxOccurs="unbounded"/&gt;
        &lt;element name="oldBook" type="string" minOccurs="0" maxOccurs="unbounded"/&gt;
     &lt;/sequence&gt;
  &lt;/complexType&gt;
  </code></pre>
  
  <p>XJC generates BookShelf class with two lists, one for newBook and one for oldBook. Excellent!</p>
  
  <p>Now I want books to appear in any order. So I rewrite my schema to:</p>
  
  <pre><code>&lt;complexType name="BookShelf"&gt;
     &lt;sequence&gt;
        &lt;choice minOccurs="0" maxOccurs="unbounded"&gt;
           &lt;element name="newBook" type="string"/&gt;
           &lt;element name="oldBook" type="string"/&gt;
        &lt;/choice&gt;
     &lt;/sequence&gt;
  &lt;/complexType&gt;
  </code></pre>
  
  <p>But now XJC generates BookShelf with only one list newBookOrOldBook of type <code>List&lt;JAXBElement&lt;String&gt;&gt;</code>.</p>
  
  <p>I don't care about the order in which books appear and I want to allow XML writer to specify books in any order he\she wishes, but I still want books of each type as List in generated BookShelf class. Is there any way I can achieve this?</p>