title: XSD allowing both simpleType and complexType content for same element?
body: <p>I have a situation where I have different XMLs that will have different types of properties. Sometimes the element <code>HEADER</code> could have just a node or some XMLs could have elements within the <code>HEADER</code> node and values inside.</p>
  
  <p><strong>Example 1 (<code>HEADER</code> with just text):</strong></p>
  
  <pre><code>&lt;Details HeaderLabel="DETAILS"&gt;
     &lt;HEADER Label="Header"&gt;2.5%&lt;/HEADER&gt;
  &lt;/Details&gt;
  </code></pre>
  
  <p><strong>Example 2 (<code>HEADER</code> with two child elements):</strong></p>
  
  <pre><code>&lt;Details HeaderLabel="DETAILS"&gt;
     &lt;HEADER Label="Header"&gt;
         &lt;HEAD Label="H1a"&gt;2.88%&lt;/HEAD&gt;
         &lt;HEAD Label="H2b"&gt;3.24%&lt;/HEAD&gt;
     &lt;/HEADER&gt;
  &lt;/Details&gt;
  </code></pre>
  
  <p>The XSD works as so:
  This will validate for <strong>example 1</strong>:</p>
  
  <pre><code>&lt;xs:element name="HEADER"&gt;
     &lt;xs:complexType&gt;
        &lt;xs:simpleContent&gt;
           &lt;xs:extension base="xs:string"&gt;
              &lt;xs:attribute name="Label" type="xs:string" use="required" /&gt;
            &lt;/xs:extension&gt;
         &lt;/xs:simpleContent&gt;
      &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
  </code></pre>
  
  <p>This will validate the <strong>example 2</strong>:</p>
  
  <pre><code>&lt;xs:element name="HEADER"&gt;
     &lt;xs:complexType&gt;
        &lt;xs:sequence&gt;
           &lt;xs:element maxOccurs="unbounded" name="HEAD"&gt;
             &lt;xs:complexType&gt;
               &lt;xs:simpleContent&gt;
                 &lt;xs:extension base="xs:string"&gt;
                   &lt;xs:attribute name="Label" type="xs:string" use="required" /&gt;
                 &lt;/xs:extension&gt;
               &lt;/xs:simpleContent&gt;
             &lt;/xs:complexType&gt;
           &lt;/xs:element&gt;
         &lt;/xs:sequence&gt;
       &lt;xs:attribute name="Label" type="xs:string" use="required" /&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
  </code></pre>
  
  <p>I tried using <code>xs:choice</code> but it didn't seem to work well or maybe I don't have a clear understanding on how to implement choice in this situation. </p>