However, the solution here seems to be to use the XQuery "import module" expression
and provide our own URL protocol handler to intercept the attempt to load the
library module. 

 
Yes, for the moment, I think that's the case. In due course I would hope to provide some kind of URIResolver mechanism, and indeed to provide system-level support for independent compilation of modules.
 
Anyone reading this who wants to sponsor such developments is of course welcome to discuss it!
 
Michael Kay
Saxonica Limited