(: Print all titles starting with "T" from the database "books" and order them alphabetically:) for $title in db:open("books")//title let $t := $title/text() where starts-with($t,"T") order by $t ascending return $t, "", (: Print distinct authors by grouping them :) for $book in db:open("books")//book group by $author := $book/author/text() return $author