declare option output:omit-xml-declaration "no"; import module namespace j='http://jidanni.org/' at "./j.xq";
causes a never ending nightmare of
Stopped at line 2, column 8 in /home/jidanni/millerliu/air/rcr7.xq: [XPST0003] Unexpected end of query: 'module namespac...'.
The error message should simply tell the user to put the imports first.