title: Forcing Jaxb preference of union member type when compiling
body: <p>I am compiling an XSD using xjc that includes the following type:</p>
  
  <pre><code>&lt;xs:simpleType name="CPT-DateTime"&gt;
      &lt;xs:annotation&gt;
          &lt;xs:appinfo&gt;Can be specified as a integer number or as xs:dateTime&lt;/xs:appinfo&gt;
      &lt;/xs:annotation&gt;
      &lt;xs:union memberTypes="xs:unsignedLong xs:dateTime"/&gt;
  &lt;/xs:simpleType&gt;
  </code></pre>
  
  <p>The resulting classes that use this type are compiled with this element set as String, while I would prefer them to use XMLGregorianCalendar. </p>
  
  <p>Is there a way to that would force xjc to pick the xs:dateTime member type over the String? I've seen how to do this for <a href="https://jaxb.java.net/guide/Using_different_datatypes.html" rel="nofollow">simple types</a> but not unions.</p>