XsltCompiler compiler = processor.newXsltCompiler();
XsltExecutable exec = compiler.compile(stylesheet);
PreparedStylesheet ps = exec.getUnderlyingCompiledStylesheet();
fl = ps.getFunctionLibrary();
} else {
XQueryCompiler xqcomp = processor.newXQueryCompiler();
StaticQueryContext sqc = xqcomp.getUnderlyingStaticContext();
sqc.compileLibrary(connection.getInputStream(), "utf-8");
XQueryExpression xqe = sqc.compileQuery("import module namespace f='" + ns + "'; .");
QueryModule qm = xqe.getStaticContext();
fl = qm.getGlobalFunctionLibrary();