title: XML Schema with a combination of "choice" and "all"
body: <p>I am trying to write an XSD that will validate XML where the following must be true:</p>
  
  <p>An element (Parent) includes:</p>
  
  <ul>
  <li>either "Choice1" OR "Choice2" elements</li>
  <li>plus any or all of "Field1", "Field2", "Field2" (etc.)</li>
  <li>The above fields can appear in any order</li>
  </ul>
  
  <p>So, for example, valid XML would be:</p>
  
  <pre><code>&lt;Parent&gt;
    &lt;Choice1&gt;xxx&lt;/Choice1&gt;
    &lt;Field1&gt;yyy&lt;/Field1&gt;
    &lt;Field2&gt;yyy&lt;/Field2&gt;
  &lt;/Parent&gt;
  </code></pre>
  
  <p>as would:</p>
  
  <pre><code>&lt;Parent&gt;
    &lt;Field3&gt;yyy&lt;/Field3&gt;
    &lt;Choice2&gt;xxx&lt;/Choice2&gt;
    &lt;Field2&gt;yyy&lt;/Field2&gt;
  &lt;/Parent&gt;
  </code></pre>
  
  <p>Invalid would be:</p>
  
  <pre><code>&lt;Parent&gt;
    &lt;Field3&gt;yyy&lt;/Field3&gt;
    &lt;Field2&gt;yyy&lt;/Field2&gt;
  &lt;/Parent&gt;
  </code></pre>
  
  <p>I can't seem to nest xs:choice and xs:all as I would like to.</p>