title: How to define alternate XML structures in XSD schema?
body: <p>How do you define alternate XML structures in xsd schema? For example the next structures would be optional:</p>
  
  <pre><code>&lt;a&gt;
    &lt;b/&gt;
    &lt;c&gt;
      &lt;d/&gt;
    &lt;/c&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;a&gt;
    &lt;c&gt;
      &lt;e/&gt;
    &lt;/c&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>In the first case there would have to be "b" element if "d" element would be found under "c" element. In the second case there would be NO "b" element allowed if there would be "e" under "c". So I'm looking for sort of this kind of solution:</p>
  
  <pre><code>&lt;xsd:element name="a"&gt;
      &lt;xsd:complexType&gt;
          &lt;xsd:all&gt;
  </code></pre>
  
  <p>(</p>
  
  <pre><code>            &lt;xsd:element name="b" type="whatever"/&gt;
              &lt;xsd:element name="c"&gt;
                  &lt;xsd:complexType&gt;
                      &lt;xsd:all&gt;
                          &lt;xsd:element name="d" type="whatever"/&gt;
                      &lt;/xsd:all&gt;
                  &lt;/xsd:complexType&gt;
              &lt;/xsd:element&gt; )
  </code></pre>
  
  <p>) OR (</p>
  
  <pre><code>            &lt;xsd:element name="c"&gt;
                  &lt;xsd:complexType&gt;
                      &lt;xsd:all&gt;
                          &lt;xsd:element name="e" type="whatever"/&gt;
                      &lt;/xsd:all&gt;
                  &lt;/xsd:complexType&gt;
              &lt;/xsd:element&gt;
  </code></pre>
  
  <p>)</p>
  
  <pre><code>        &lt;/xsd:all&gt;
      &lt;/xsd:complexType&gt;
  &lt;/xsd:element&gt;
  </code></pre>
  
  <p>The reason I wouldn't want to use choice element is because I'm making an editor interface for an XML document and choice would simply look stupid in the editor interface in my case.</p>