for $b in document("bib.xml")//book
where $b/publisher = "Morgan Kaufmann" AND $b/year = "1998"
return $b/title
becomes:
<q:flwr>
<q:forAssignment variable="$b">
<q:step axis="slashslash">
<q:function name="document">
<q:constant datatype="charstring">bib.xml</q:constant>
</q:function>
<q:identifier>book</q:identifier>
</q:step>
</q:forAssignment>
<q:where>...</q:where>
<q:return>...</q:return>
</q:flwr>