Thanks fixed this by migrating all inflight process instances and tasks to latest process definition(latest deployment) . In our scenario, the definitions haven't changed , so I thought its probably alright to refer to new definition.
Could you please share your skeleton code to do the XML update?