67
XQuery: Nesting
•For each author of a book by Morgan Kaufmann, list all books she published:
FOR $a IN distinct(document("bib.xml")
                             /bib/book[publisher=“Morgan Kaufmann”]/author)
RETURN <result>
                     { $a,
                        FOR $t IN /bib/book[author=$a]/title
                        RETURN $t
                     }
                 </result>