I've published source code for a webapp which performs non-interactive processing of an OpenDoPE docx. The idea is that you provide the docx and an xml file, and the servlet will process that and then stream you the resulting docx.
A web app is a better approach than a command line app which exits after each run, since you don't incur Context startup time for each document.
You can find the source code at ...