for $art in collection("talismane_3546")//file for $elt in $art/item let $conc2 := if (($elt/a[4]/text()="NC") and ($elt/following-sibling::item[1]/a[4]/text()="P") and ($elt/following-sibling::item[2]/a[4]/text()="NC") and ($elt/following-sibling::item[3]/a[4]/text()="P") and ($elt/following-sibling::item[4]/a[4]/text()="NC")) then ( concat($elt/a[2]/text()," ",$elt/following-sibling::item[1]/a[2]/text()," ",$elt/following-sibling::item[2]/a[2]/text()," ",$elt/following-sibling::item[3]/a[2]/text()," ",$elt/following-sibling::item[4]/a[2]/text()) ) else 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()="ADJ") and ($elt/following-sibling::item[1]/a[4]/text()="NC")) then ( concat($elt/a[2]/text()," ",$elt/following-sibling::item[1]/a[2]/text()) ) else if (($elt/a[4]/text()="V") and ($elt/following-sibling::item[1]/a[4]/text()="DET") and ($elt/following-sibling::item[2]/a[4]/text()="NC")) then ( concat($elt/a[2]/text()," ",$elt/following-sibling::item[1]/a[2]/text()," ",$elt/following-sibling::item[2]/a[2]/text()) ) else ( " " ) where $conc2 != " " return $conc2