I have added the declaration:
declare option exist:serialize "method=xml media-type=application/xml process-xsl-pi=yes";
to my xquery but the "process-xsl-pi=yes" isn't working within eXist.  The processing-instruction is sent with the document to my browser. The browser tries to resolve http://localhost:8080/exist/xquery/lowercase.xsl and fails because Cocoon isn't serving xsl files.  I have the template on disk and I have it in the database at /db/modelXSL/lowercase.xsl.  With the REST interface, I was able to use the parameter _query={$path}&_xsl=modelXSL/lowercase.xsl.  Now that I'm using an .xql file on disk, I need to duplicate this behaviour somehow.  Suggestions or insights?