(: Build a portfolio of paper titles per author. Report the list of authors who have more than one paper. Over bibliography.xml. parke godfrey 2013-11-06 Fixed so no duplicates. :) { let $portfolios := { for $author in doc("bibliography.xml")//author/text() group by $author order by $author return { for $paper in doc("bibliography.xml") //paper[.//author/text() = $author] return $paper/title } } for $author in $portfolios/portfolio let $count := count($author/title) where $count > 1 return {$author/@author/data()} }