title: XML Schema - child elements dependent on existence of optional attribute
body: <p>Is it possible to define in XSD the following scenario:</p>
  
  <ol>
  <li><p>Parent element has an attribute that</p>
  
  <p>is optional. </p></li>
  <li><p>If the attribute is not</p>
  
  <pre><code>present in XML, at least one child
  
  element must exists.
  </code></pre></li>
  <li><p>If the</p>
  
  <pre><code>attribute is present, there can be
  
  zero or more child elements.
  </code></pre></li>
  </ol>
  
  <p>Example:</p>
  
  <p>VALID</p>
  
  <pre><code>&lt;parent externel-source="some_name" /&gt;
  
  
  
  &lt;parent externel-source="some_name"&gt;
  
    &lt;child&gt;some value&lt;/child&gt;
  
  &lt;/parent&gt;
  
  
  
  &lt;parent&gt;
  
    &lt;child&gt; some value&lt;/child&gt;
  
  &lt;/parent&gt;
  </code></pre>
  
  <p>NOT VALID</p>
  
  <pre><code>&lt;parent /&gt;
  </code></pre>