To basex developers, The following xquery returns 464 <persName> elements with saxonHE but fails to produce any <persName> elements when the query is run in basex (6.1.3). for $RT in ("c31a") let $theseRecs := //c31a[sourceVol="CON 31/2"] let $ctr := count($theseRecs) let $pList := <listPersName n="{$ctr}">{ for $p at $i in $theseRecs let $conref := if ( $RT = "c37v" ) then <hi/> else () return <persName id="{$p/@xml:id}">{$i}</persName> }</listPersName> return ( $pList,<hello/> ) If the xquery null sequence () in line 6 is changed to an empty string: else "" I get the expected 464 results. With () in the else I get only this: <listPersName n="464"/> <hello/> I had a devil of a time detecting this. I also have encountered bad behaviour when running queries against attributes which exist but have no value, like this: <el attr=""> In Saxon I can search for //el[@attr=""] and get results but basex does not find these cases. Hoping these bugs can be quickly squashed. regards, Sandra