Is simply invoking the same XQuery using RUN from the command line all I have to do to get the benefits of using the CL?
You could as well try to pack your code into some BaseX command scripts:
http://docs.basex.org/wiki/Commands#Command_Scripts
If you write your updating queries in XQuery, you are much more flexible, but (due to the underlying semantics) all update operations will first need to be cached before they can be executed, which means you may soon hit memory limits. You can elude those limits by creating a custom command script that contains all the update operations. In some scenarios, the creation of those scripts is directly done via XQuery, and deleted after having been successfully executed.
But I can't pass this XML into a function to perform the updates, since I can't put update operations into a function at all.
Do you refer to XQuery functions? This can be mode possible by adding the %updating annotation to your function declaration:
http://docs.basex.org/wiki/XQuery_Update#Function_Declaration
If this doesn’t help, feel free to send us a small XQuery snippet that demonstrates the issue.
Christian