On Sep 19, 2017, at 5:48 PM, Christian Grün <christian.gruen@gmail.com> wrote:for $u in db:open("db1")/text/s/t
group by $k := $u/f || "#" || $u/@o
where db:open("db2")/text/line[text() = string($k)]
let $n := count($u)
order by $n descending
return $k || " " || $n