Вы можете использовать функции xdmp:node-insert-before()
и xdmp:node-delete()
:
let $doc :- fn:doc("/uri/of/your/doc.xml")
let $long := $doc/root/Longitude
let $lat := $doc/root/Latitude
(: construct an element with text() value of the Longitude and Latitude elements :)
let $point := <cordinate-point>{string-join(($lat,$long), ",")}</cordinate-point>
return
(
(: insert a new coordinate-point element before the Longitude element :)
xdmp:node-insert-before($long, $point),
(: Remove the Longitude element :)
xdmp:node-delete($long),
(: Remove the Latitude element :)
xdmp:node-delete($lat)
)