xquery version "3.1"; declare namespace map="http://www.w3.org/2005/xpath-functions/map"; declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare option output:indent "yes"; let $module := load-xquery-module("http://mathling.com/test/load", map {"location-hints": "imported.xqy"}) let $variables := $module("variables") let $functions := $module("functions") return ( { for $v in $variables=>map:keys() return , for $f in $functions=>map:keys() return } )