title: jaxb element with complexContent, restriction and attribute
body: <p>I need to implement JAXB for the following XML model</p>
  
  <pre><code>&lt;OrderItemList&gt;
      &lt;ItemCount&gt;2&lt;/ItemCount&gt;
      &lt;OrderItem Sequence="1"&gt;
        &lt;ItemId&gt;12345&lt;/ItemId&gt;
        &lt;Quantity&gt;1&lt;/Quantity&gt;
        &lt;DiscountId&gt;prm&lt;/DiscountId&gt;
        &lt;DiscountPercent&gt;3.5&lt;/DiscountPercent&gt;
      &lt;/OrderItem&gt;
      &lt;OrderItem Sequence="1"&gt;
        &lt;ItemId&gt;44523&lt;/ItemId&gt;
        &lt;Quantity&gt;3&lt;/Quantity&gt;
        &lt;DiscountId&gt;nil&lt;/DiscountId&gt;
        &lt;DiscountPercent&gt;0&lt;/DiscountPercent&gt;
      &lt;/OrderItem&gt;
  &lt;/OrderItemList&gt;
  </code></pre>
  
  <p>I'm getting the following errors:</p>
  
  <pre><code>16:15:28,564 WARN  [OrderItemValidate] [error] null : cvc-complex-type.3.2.2: Attribute 'Sequence' is not allowed to appear in element 'OrderItem'.
  16:15:28,565 ERROR [OrderItemValidate] org.xml.sax.SAXParseException; lineNumber: 7; columnNumber: 24; cvc-complex-type.3.2.2: Attribute 'Sequence' is not allowed to appear in element 'OrderItem'.
  org.xml.sax.SAXParseException; lineNumber: 7; columnNumber: 24; cvc-complex-type.3.2.2: Attribute 'Sequence' is not allowed to appear in element 'OrderItem'.
  
  22:05:09,966 WARN  [OrderItemValidate] [error] null : cvc-complex-type.2.4.a: Invalid content was found starting with element 'TotalCount'. One of '{"www.myapp.com":OrderItem}' is expected.
  22:05:09,967 ERROR [OrderItemValidate] org.xml.sax.SAXParseException; lineNumber: 7; columnNumber: 17; cvc-complex-type.2.4.a: Invalid content was found starting with element 'TotalCount'. One of '{"www.myapp.com":OrderItem}' is expected.
  org.xml.sax.SAXParseException; lineNumber: 7; columnNumber: 17; cvc-complex-type.2.4.a: Invalid content was found starting with element 'TotalCount'. One of '{"www.myapp.com":OrderItem}' is expected.
  </code></pre>
  
  <p>I tried the following ways, </p>
  
  <pre>
   * &lt;complexType name="OrderItem">
   *   &lt;complexContent>
   *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
   *       &lt;all>
   *         &lt;attribute name="Sequence" type="{www.myapp.com}Integer" use="required"/>
   *         &lt;element name="ItemId" type="{www.myapp.com}String" minOccurs="0"/>
   *         &lt;element name="Quantity" type="{www.myapp.com}Integer" minOccurs="0"/>
   *         &lt;element name="DiscountId" type="{www.myapp.com}Number" minOccurs="0"/>
   *         &lt;element name="DiscountPercent" type="{www.myapp.com}Number" minOccurs="0"/>
   *       &lt;/all>
   *     &lt;/restriction>
   *   &lt;/complexContent>
   * &lt;/complexType>
   * </pre>
  
  <ul>
  <li><pre><code>  &lt;ItemId&gt;12345&lt;/ItemId&gt;
    &lt;Quantity&gt;1&lt;/Quantity&gt;
    &lt;DiscountId&gt;prm&lt;/DiscountId&gt;
    &lt;DiscountPercent&gt;3.5&lt;/DiscountPercent&gt;
  </code></pre></li>
  </ul>