instead of including an xml parser for pvm processes, i have created org.jbpm.pvm.ProcessBuilder, a class to create processes.
ProcessBuilder is stateful. This means that a method wil apply to the last applicable object. E.g. if you call transition, a transition will be added to the last added node. This also holds for most other methods.
Every method returns the ProcessBuilder itself. So you can concatenate many invocations. You can introduce indentation in the list of method invocations so that the Java code becomes very similar to process XML. But of course, you got java code completion.
I think this is more convenient then writing xml strings in unit tests.
For an example, have a look at test/java/org/jbpm/pvm/WaitStateTest.java