title: XSD: Check that element with specific value presents
body: <p>I have xml from XMPP core:</p>
  
  <pre><code> &lt;mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"&gt;
     &lt;mechanism&gt;X-OAUTH2&lt;/mechanism&gt;
     &lt;mechanism&gt;X-GOOGLE-TOKEN&lt;/mechanism&gt;
     &lt;mechanism&gt;PLAIN&lt;/mechanism&gt;
   &lt;/mechanisms
  </code></pre>
  
  <p>And i want to check that it contain one element PLAIN (and may be other, but PLAIN is required). I tried to do it with restrictions, but i can't make right rule. My attempt:</p>
  
  <pre><code>&lt;xs:schema
         xmlns:xs='http://www.w3.org/2001/XMLSchema'
         targetNamespace='urn:ietf:params:xml:ns:xmpp-sasl'
         xmlns='urn:ietf:params:xml:ns:xmpp-sasl'
         elementFormDefault='qualified'&gt;
    &lt;xs:element name='mechanisms'&gt;
      &lt;xs:complexType&gt;
        &lt;xs:all&gt;
          &lt;xs:element ref='mechanism' minOccurs='1' maxOccurs='1'/&gt;
        &lt;/xs:all&gt;
      &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="mechanism"&gt;
    &lt;xs:simpleType&gt;
      &lt;xs:restriction base="xs:string"&gt;
        &lt;xs:pattern value="PLAIN" /&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt;
    &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>Can anybody help me?</p>