fds=115 115 fds.115 xquery version '3.0'; let $context := doc($db:context) let $howmany := 1000 let $atts := $context//att[(bron/descendant::*/@fonds = 'fds.115')] return <result lem='{count($atts/preceding-sibling::lemma)}' atts='{count($atts)}' shown='{$howmany}'> { for $i in 1 to min(($howmany, count($atts))) let $att := $atts[$i] group by $lem := $att/preceding-sibling::lemma order by $lem/vorm return <entry> {$lem} {$att intersect $atts} </entry> } </result> Burgbrohl Burgbrohl Brůle 1220 D Ra 1 Horn Horn Hůrne 1220 D Ra 1 Rath Süchteln Rhode 1220 D Ra 1 Süchteln Süchteln Suchtelin 1220 D Ra 1