Did you validate your diagram against the BPMN 2.0 XML schema using an XSD validator to determine if it is valid BPMN? I’d consider you to do it to prevent silly mistakes such as malformed xsd:id
elements (numbers only).
Once everything is there you can check the diagram for import errors and warnings, cf. bpmn-js usage.
But really, your first “quality gate” should be a passing XSD schema validation (against the BPMN 2.0 XML schema).