for $art in collection("sortietalismane-slurp_3208.xml")//p for $elt in $art/item let $conc2 := if (($elt/a[4]/text()="NC") and ($elt/following-sibling::item[1]/a[4]/text()="ADJ")) then ( concat($elt/a[2]/text()," ",$elt/following-sibling::item[1]/a[2]/text()) ) else if (($elt/a[4]/text()="NPP") and ($elt/following-sibling::item[1]/a[4]/text()="ADJ")) then ( concat($elt/a[2]/text()," ",$elt/following-sibling::item[1]/a[2]/text()) ) else ( " " ) where $conc2 != " " return $conc2