title: Same element, multiple types with XML Schema
body: <p>I want to construct the following XML:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;foo&gt;
    &lt;bar type="alpha"&gt;
      &lt;first /&gt;
      &lt;second /&gt;
    &lt;/bar&gt;
    &lt;bar type="bravo"&gt;
      &lt;third /&gt;
      &lt;fourth /&gt;
    &lt;/bar&gt;
  &lt;/foo&gt;
  </code></pre>
  
  <p>The salient point being that I want "bar" to have different child elements depending on its type -- if the type is "alpha" then the children MUST be "first" and "second", and if the type is "bravo" then the children MUST be "third" and "fourth".  XSD validators don't seem to like the idea of the same element defined with two different rulesets.</p>
  
  <p>How do I construct an XML schema document to enforce this rule?</p>