let $x := distinct-values(//entry/pos/@name) for $y in $x return($y, count(//entry/pos[contains(@*,$y)]))