The instructions to use .xql files for your queries were documented in the 4.6.3 version of the Developer Tutorial - https://openacs.org/doc/openacs-4-6-3/tutorial-pages.html - but those instructions were jettisoned in the newer versions of that document it appears.