title: xquery empty sequence how to handle
body: <p>I am trying to return either "Empty" if it is a empty sequence or "NotEmpty" if it is not. Let's say,</p>
  
  <pre><code>for $family in doc("gedcom.xml") /*/FamilyRec
  where $family/Child/Link[@Ref = "IN006"]
  return if(empty(data($family))) then "Empty" else "NotEmpty"
  </code></pre>
  
  <p>i am getting result in oxygen: NotEmpty
  which is Ok.</p>
  
  <p>but let's say, there is no value for IN005 </p>
  
  <pre><code>for $family in doc("gedcom.xml") /*/FamilyRec
  where $family/Child/Link[@Ref = "IN005"]
  return if(empty(data($family))) then "Empty" else "NotEmpty"
  </code></pre>
  
  <p>then it should print: Empty</p>
  
  <p>but instead of printing "Empty" I am getting </p>
  
  <p>Engine name: Saxon-EE XQuery 9.3.0.5
  Severity: warning
  Description: Your query returned an empty sequence.</p>
  
  <p>Can anyone please help me. Thanks in Advance.</p>