xquery version "3.0"; declare namespace join = "http://exist-db.org/xquery/admin-interface/join-abcd"; declare namespace xdb="http://exist-db.org/xquery/xmldb"; declare namespace file="http://exist-db.org/xquery/file"; (: :declare default element namespace "abcd";:) declare namespace abcd = "http://www.tdwg.org/schemas/abcd/2.06"; declare function join:get-units($colName as xs:string) as node()* { let $data-collection := concat('/db/rebind/protected/', $colName, '/abcd') for $unit in collection($data-collection)//abcd:Unit return ( $unit ) }; (: This xquery joins multiple xquery files exported from biocase stored in exist /db/rebind/protected-staging/ {$technicalContacts} {$contentContacts} {$metadata} {$abcd-data} let $store := xdb:store(concat('/db/rebind/protected/', $collection-name), concat($collection-name, '.xml'), $joined-data) return xdb:remove($data-collection) (: add parameters in request -. get login for collection? :)