title: Restricting XML Elements Based on Another Element via XSD
body: <p>I believe this has to do with <code>keyref</code> but I'm not for sure, and I am really not sure that it can be done at all.</p>
  
  <p>For example, say I have myElement1 and myElement2.  If there are no myElement2 in the XML file, then myElement1 must exist, otherwise it is optional.</p>
  
  <p>Is there any way to force this type of validation in my XSD file?</p>