title: XML Conditional Validation based on Primary Key
body: <ul>
  <li><p>Input for create Person (If PersonID don't exist then it is the input for creating new person, so input should contain other other four.)</p>
  
  <p><code>&lt;Input xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;Person&gt;
      &lt;FirstName&gt;First Name&lt;/FirstName&gt;
      &lt;LastName&gt;Last Name&lt;/LastName&gt;
      &lt;Phone&gt;1234567890&lt;/Phone&gt;
      &lt;Email&gt;username@domain.com&lt;/Email&gt;
    &lt;/Person&gt;
  &lt;/Input&gt;</code></p></li>
  <li><p>Input for update Person (If it has PersonID, then that will be the input for an update and input should contain at least one from other four along with PersonID.)</p>
  
  <p><code>&lt;Input xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;Person&gt;
      &lt;PersonID&gt;123456&lt;/PersonID&gt;
      &lt;FirstName&gt;First Name&lt;/FirstName&gt;
      &lt;LastName&gt;Last Name&lt;/LastName&gt;
      &lt;Phone&gt;1234567890&lt;/Phone&gt;
      &lt;Email&gt;username@domain.com&lt;/Email&gt;
    &lt;/Person&gt;
  &lt;/Input&gt;</code></p></li>
  </ul>
  
  <p><strong>How to write single XSD to validate the input based on the PersonID?</strong></p>
  
  <p>Thanks.</p>