title: xquery beginner- how to give a specific default value to a variable when there is no content in xml for that variable
body: <p>I am working to extract some content from a web page.</p>
  
  <p>Given below is the XQuery code I am using. I am using a XQuery library to parse through XML which is obtained by transforming a HTML web page into XML. After that I am extracting some specific content from that XML page:</p>
  
  <pre><code>declare variable $doc as node() external;
  
  let $select_block := $doc//div[@class="randomclass" and contains(.,'MatchingText')]
  for $select_link in $select_block/a 
  for $select_link_url in $select_link/@href
  where contains($assignee_link_url, 'inassignee')  
  return data($select_link)
  </code></pre>
  
  <p>From above, you can see that variable <code>$select_block</code> tries to extract content of that div of web page which has <code>class="randomclass"</code>, and which contains the text "MatchingText".</p>
  
  <p>Now, if the web page in question does not contain such a block, then how do I return a default value for <code>$select_link</code>? Basically, I want to tackle the scenario where no value is returned for a selection within an XQuery expression  so that I can mark a flag that tells the user that this value was not found.</p>