for $b in doc("sortieudpipe-3244.xml")/baseudpipe/p for $c in $b/item where $c/a[8][contains(text(), 'subj')] let $gouv := $c/a[7] let $obj := $c/a[1] let $num := $obj - $gouv let $str := if($num>0) then $c/preceding-sibling::*[$num]/a[3] else($c/following-sibling::*[-$num]/a[3]) let $strsub :=$c/a[3] return (concat($str," [",$c/a[8],"] ",$strsub))