The method XQueryCompiler.compileLibrary() given a File as the argument does not work. (It attempts to compile the contents of the file as a main module rather than as a library module). This doesn't affect other overloads of this method.
A patch is being placed in Subversion (it's in open-source code though it's only useful for Saxon-EE users). The patch also quietly fixes another problem, namely that XQueryCompiler.compile(File) creates an input stream for reading the File and doesn't close it after use.