I want to construct the following XML:
<?xml version="1.0"?>
<foo>
<bar type="alpha">
<first />
<second />
</bar>
<bar type="bravo">
<third />
<fourth />
</bar>
</foo>
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.
How do I construct an XML schema document to enforce this rule?