title: How to verify XML node value to xs:union
body: <p>For the given XSD below:</p>
  
  <pre><code>&lt;xs:element name="jeans_size"&gt;
    &lt;xs:simpleType&gt;
      &lt;xs:union memberTypes="sizebyno sizebystring" /&gt;
    &lt;/xs:simpleType&gt;
  &lt;/xs:element&gt;
  
  &lt;xs:simpleType name="sizebyno"&gt;
    &lt;xs:restriction base="xs:positiveInteger"&gt;
      &lt;xs:maxInclusive value="42"/&gt;
    &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  
  &lt;xs:simpleType name="sizebystring"&gt;
    &lt;xs:restriction base="xs:string"&gt;
      &lt;xs:enumeration value="10"/&gt;
      &lt;xs:enumeration value="11"/&gt;
      &lt;xs:enumeration value="12"/&gt;
    &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  </code></pre>
  
  <p>We have a XML node:</p>
  
  <pre><code>&lt;jeans_size&gt;10&lt;/jeans_size&gt;
  </code></pre>
  
  <p>How does XSD engine determine which type is that <code>10</code>? <code>xs:union</code> means <code>or</code>, so it's either <code>xs:positiveInteger</code> or <code>xs:string</code>. Do we represent a <code>string</code> as <code>&lt;jeans_size&gt;'10'&lt;/jeans_size&gt;</code> in XML?</p>