final TransactionConfig nestedConfig = new MuleTransactionConfig();
nestedConfig.setFactory(new XaTransactionFactory());
nestedConfig.setAction(TransactionConfig.ACTION_BEGIN_OR_JOIN);
// start the call chain
template.execute(new TransactionCallback<Void>()
{
public Void doInTransaction() throws Exception
{
// the callee executes within its own TX template, but uses the same global XA transaction,
// bound to the current thread of execution via a ThreadLocal