Would it be possible to ID-ify all diagram elements with IDs taken from the diagram text? So for instance the blow rectangle element would have a unique ID: "BL" or according to some other convention e.g: "BL-rectangle"
<g>
<!--entity BL-->
<rect fill="#FEFECE" filter="url(#f19hfjnydgqirs)" height="37.6094" style="stroke: #A80036; stroke-width: 1.5;" width="115" x="12" y="30.6406"/>
The reason is to give an ability to post-process SVG content after the diagram is generated.