XProc can be used very well for implementing command line applications that work lots of documents, processing/building directory structures, etc. There are two design patterns that help:
Job tickets, using some internal Domain Specific Language (DSL), greatly simplifies the application logic.
If you handle the command line in a separate wrapper step, the steps that implement the actual functionality become more reusable.