Use getFlowElements() on the Process (fetched from the BPMNModel). If it's a UserTask, print it. If it's a CallActivity, use the "calledElement" property to get hold of the key of the referenced definition. With this key, fetch the ID of the latest definition and fetch it's BPMNModel - and do the same handling as you did with the BPMNModel you're currently looping (recursively).
Do bare in mind that it's possible to use expressions in the calledElement value of a CallActivity XML. Make sure you only use process-definitions with a fixed pointer to a process definition key in order for the mechanism described above, to work.