===XQuery (with files)===
User-defined library Library modules can be imported and used as followsby specifying a location in the module import statement. The path must be relative to the location (i.e., ''static base URI'') of the calling module:
;Contents of the library Main Module''' <code>HelloUniverse.xq</code>: <pre class="brush:xquery">import module namespace m = 'http://basex.org/modules/Hello' at 'HelloWorld.xqm';m:hello("Universe")</pre> '''Library Module''' <code>[http://files.basex.org/modules/org/basex/modules/Hello/HelloWorld.xqm HelloWorld.xqm]</code> (comments removedin the same directory):
<pre class="brush:xquery">
'Hello ' || $world
};
</pre>
;XQuery file <code>HelloUniverse.xq</code>. The specified module path is relative to the location (i.e., ''static base URI'') of the calling module:
<pre class="brush:xquery">
import module namespace m = 'http://basex.org/modules/Hello' at 'HelloWorld.xqm';
m:hello("Universe")
</pre>