title: XML Schema - Restrict element to enum or keyref
body: <p>I am trying to write a schema, and I want to restrict the value or an element to either an enumerated list, or to a key reference.  Is this possible? ie, im my schema I have </p>
  
  <pre><code>   &lt;xsd:simpleType name="TypeEnum"&gt;
        &lt;xsd:restriction base="xsd:string"&gt;
           &lt;xsd:enumeration value="uint8" /&gt;
           &lt;xsd:enumeration value="uint16" /&gt;
           &lt;xsd:enumeration value="uint32" /&gt;
           &lt;xsd:enumeration value="uint64" /&gt;
        &lt;/xsd:restriction&gt;
     &lt;/xsd:simpleType&gt;
  </code></pre>
  
  <p>and in my XML i have </p>
  
  <pre><code>&lt;root&gt;
     &lt;a&gt;anEnum&lt;a&gt; &lt;!-- This value should be restricted to either anEnum, anotherEnum or anything in TypeEnum --&gt;
     &lt;AdditionalTypes&gt;
        &lt;Enum Name="anEnum" /&gt;
        &lt;Enum Name="anotherEnum" /&gt;
     &lt;/AdditionalTypes&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>My question is how do I structure the schema element definition for <code>&lt;a&gt;</code></p>
  
  <p>Thanks in advance for any help.</p>