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:function name="and"> <q:function name="equals"> <q:step axis="child"> <q:variable>$b</q:variable> <q:identifier>publisher</q:identifier> </q:step> <q:constant datatype="charstring">Morgan Kaufmann</q:constant> </q:function> <q:function name="equals"> <q:step axis="child"> <q:variable>$b</q:variable> <q:identifier>year</q:identifier> </q:step> <q:constant datatype="charstring">1998</q:constant> </q:function> </q:function> </q:where> <q:return> <q:step axis="child"> <q:variable>$b</q:variable> <q:identifier>title</q:identifier> </q:step> </q:return> </q:flwr>