xquery version "3.1"; ( exrest:register-module(xs:anyURI("/db/apps/SADE/modules/fontane/index-api.xqm")), exrest:register-module(xs:anyURI("/db/apps/SADE/modules/fontane/toc-api.xqm")), (let $doc := doc("expath-pkg.xml")//*:package, $app := string($doc/@abbrev), $version := string($doc/@version), $filename := string-join(("/tmp/tests", $app, $version), "-") || ".xml", $node := {util:eval(xs:anyURI("/db/apps/SADE/modules/fontane/tests.xq"))} , $sysout := util:log-system-out($node) return file:serialize($node, $filename, ()) ) )