title: How to group types & subtypes in XSD
body: <p>I have XML like this:</p>
  
  <pre><code>&lt;type&gt;
      &lt;mainType&gt;...&lt;/mainType&gt;
      &lt;subtype&gt;...&lt;subtype&gt;
  &lt;/type&gt;
  </code></pre>
  
  <p>The mainTypes are restricted xs:strings (a list of them). And each mainType has a list of possible subtypes. IE:<br>
  mainTypeA has possible subtypes of: subtype1, subtype2, subtype3<br>
  mainTypeB has possible subtyes of: subtype4, subtype5  </p>
  
  <p>How can I represent this in XSD so that each of subtype enumerations are linked specifically to their main type?
  Is there a better way to represent those 2 fields to make the XSD simpler? I am not opposed to changing the XML document structure.</p>