title: XSD - How to describe an unordered set of element types where the first element must appear first in the sequence?
body: <p>This is an XML schema question.</p>
  <p>I know that <code>xsd:all</code> element can't appear in a sequence (must be the top level element of its type).</p>
  <p>That is, I cannot use the following:</p>
  <pre><code>&lt;xsd:complexType name=&quot;Application&quot;&gt;
    &lt;xsd:sequence&gt;
      &lt;xsd:element ref=&quot;Name&quot;&gt;&lt;/xsd:element&gt;
      &lt;xsd:all&gt;
        &lt;xsd:element ref=&quot;ADD&quot;&gt;&lt;/xsd:element&gt;
        &lt;xsd:element ref=&quot;DELETE&quot;&gt;&lt;/xsd:element&gt;
      &lt;/xsd:all&gt;
    &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;
  </code></pre>
  <p>My question is how to declare the &quot;ADD&quot; and &quot;DELETE&quot; elements above in any order (unordered set) but still make sure that the element &quot;Name&quot; would be the first and always appear.  (Think of the situation where I have not only &quot;ADD&quot; and &quot;DELETE&quot; but about 10 or more unordered elements set: ADD, DELETE, EDIT etc...)</p>
  <p>IMPORTANT NOTE: the ADD and DELETE may appear only ONCE, but their order is not matter:</p>
  <pre><code>&lt;Application&gt;
    &lt;NAME&gt;
    &lt;DELETE&gt;
    &lt;ADD&gt;
  &lt;/Application&gt;
  </code></pre>
  <p>but NOT:</p>
  <pre><code>&lt;Application&gt;
    &lt;NAME&gt;
    &lt;DELETE&gt;
    &lt;ADD&gt;
    &lt;DELETE&gt; &lt;!--cannot appear twice--&gt;
  &lt;/Application&gt;
  </code></pre>