Thanks for the reply.
I had a look at Switchyard, but I prefer to not include additional frameworks to do something that I thought was simple.
After some Googling it seems that I could use XPath for dataInputAssociation (as described in https://community.jboss.org/thread/177695) but I had no luck in finding any example on this.
For instance, with regard to my sample XML document, I would like to assign <a> and <b> to a task variable (eg. a script task) and use the task to get the sum and assign it to the <sum> tag (this tag could not be present in the original xml document).
Also, I am trying to understand if I can use a condition (eg. a < b) for a sequence flow, where the condition affects the values of the xml tags.
Have you any BPMN 2.0 xml example to do this?