fds=105 105 fds.105 xquery version '3.0'; let $context := doc($db:context) let $howmany := 1000 let $atts := $context//att[(bron/descendant::*/@fonds = 'fds.105')] 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> Mark Hamm Marcha 1223 D Kl 1 Mergelp Wyler Mergelpe 1223 D Kl 1 Rees Rees Resa 1223 D Kl 1 Wyler Wyler Wilre 1223 D Kl 1