title: Define an element in XSD which is an ENUM and has one attribute
body: <p>I'd like to have the XSD for the following xml:</p>
  
  <pre><code>&lt;root&gt;
      &lt;tag&gt;
          &lt;child1&gt;value1_1&lt;/child1&gt;
          &lt;child2 att="att1"&gt;value2_1&lt;/child2&gt;
      &lt;/tag&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>With the following XSD</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;xs:element name="root" type="rootMeta"/&gt;
      &lt;xs:element name="tag" type="tagMeta"/&gt;
  
      &lt;xs:complexType name="rootMeta"&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element ref="tag" minOccurs="0" maxOccurs="unbounded"/&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
  
      &lt;xs:complexType name="tagMeta"&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element name="child1" type="enum1"/&gt;
              &lt;xs:element name="child2" type="enum2"/&gt;
          &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;`
  
      &lt;xs:simpleType name="enum1"&gt;
          &lt;xs:restriction base="xs:string"&gt;
              &lt;xs:enumeration value="value1_1"/&gt;
              &lt;xs:enumeration value="value1_2"/&gt;
          &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
  
      &lt;!-- And here the problem comes --&gt;
  
      &lt;xs:complexType name="enum2"&gt;
          &lt;xs:simpleContent&gt;
              &lt;xs:restriction base="xs:string"&gt;
                &lt;xs:enumeration value="value2_1"/&gt;
                &lt;xs:enumeration value="value2_2"/&gt;
              &lt;/xs:restriction&gt;
          &lt;/xs:simpleContent&gt;
          &lt;xs:attribute name="att" type="attMeta" use="required"/&gt;
      &lt;/xs:complexType&gt;
  
      &lt;xs:simpleType name="attMeta"&gt;
          &lt;xs:restriction base="xs:string"&gt;
              &lt;xs:enumeration value="att1"/&gt;
              &lt;xs:enumeration value="att2"/&gt;
          &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>The definition is wrong and the validation cannot be done, can anyone explain me how shall I define <em>enum2</em> to have an enum as a value and also an attribute?</p>