Apache Ant/Execute an XQuery

Motivation
You want to execute an XQuery that is stored in an eXist database.

Remote execution of an inline query
Note that you only can return a string in this example. Any XML content in the query will generate an error.

If you want to return an XML file into a property you will need to wrap you query in a CDATA structure:

Execute an XQuery Stored in Local Drive
hello-world.xq: This is similar to the version above but you will note that the queryfile attribute has been added.

Note for the above to work the file hello-word.xq MUST be in the same directory as the build script.

Adding Execute Permissions
Where the local-uri is something like: xmldb:exist://localhost:8080/exist/xmlrpc/db for the default installation path