How to create & attach a boundary error event to an activity inside a CustomBPMNParseListener

Hi,
I am trying to create a boundary error event dynamically while parsing the BPMN process in CustomBPMNParseListener. And then I have to attach this event to an existing activity(e.g. CallActivity).

Any help or suggestion is highly appreciated.
Thanks in advance.

Here is a alternative to using the parse listener, allowing you to use the model fluent API: Ability to edit BpmnModelInstance before bpmn parse listener?