@staticmethod<EOL><INDENT>def load_diagram_from_xml(filepath, bpmn_diagram):<DEDENT>
diagram_graph = bpmn_diagram.diagram_graph<EOL>sequence_flows = bpmn_diagram.sequence_flows<EOL>process_elements_dict = bpmn_diagram.process_elements<EOL>diagram_attributes = bpmn_diagram.diagram_attributes<EOL>plane_attributes = bpmn_diagram.plane_attributes<EOL>collaboration = bpmn_diagram.collaboration<EOL>document = BpmnDiagramGraphImport.read_xml_file(filepath)<EOL>diagram_element = document.getElementsByTagNameNS("<STR_LIT:*>", "<STR_LIT>")[<NUM_LIT:0>]<EOL>plane_element = diagram_element.getElementsByTagNameNS("<STR_LIT:*>", "<STR_LIT>")[<NUM_LIT:0>]<EOL>BpmnDiagramGraphImport.import_diagram_and_plane_attributes(diagram_attributes, plane_attributes,<EOL>diagram_element, plane_element)<EOL>BpmnDiagramGraphImport.import_process_elements(document, diagram_graph, sequence_flows, process_elements_dict,<EOL>plane_element)<EOL>collaboration_element_list = document.getElementsByTagNameNS("<STR_LIT:*>", consts.Consts.collaboration)<EOL>if collaboration_element_list is not None and len(collaboration_element_list) > <NUM_LIT:0>:<EOL><INDENT>collaboration_element = collaboration_element_list[<NUM_LIT:0>]<EOL>BpmnDiagramGraphImport.import_collaboration_element(diagram_graph, collaboration_element, collaboration)<EOL><DEDENT>if consts.Consts.message_flows in collaboration:<EOL><INDENT>message_flows = collaboration[consts.Consts.message_flows]<EOL><DEDENT>else:<EOL><INDENT>message_flows = {}<EOL><DEDENT>participants = []<EOL>if consts.Consts.participants in collaboration:<EOL><INDENT>participants = collaboration[consts.Consts.participants]<EOL><DEDENT>for element in utils.BpmnImportUtils.iterate_elements(plane_element):<EOL><INDENT>if element.nodeType != element.TEXT_NODE:<EOL><INDENT>tag_name = utils.BpmnImportUtils.remove_namespace_from_tag_name(element.tagName)<EOL>if tag_name == consts.Consts.bpmn_shape:<EOL><INDENT>BpmnDiagramGraphImport.import_shape_di(participants, diagram_graph, element)<EOL><DEDENT>elif tag_name == consts.Consts.bpmn_edge:<EOL><INDENT>BpmnDiagramGraphImport.import_flow_di(diagram_graph, sequence_flows, message_flows, element)<EOL><DEDENT><DEDENT><DEDENT>
Reads an XML file from given filepath and maps it into inner representation of BPMN diagram.
Returns an instance of BPMNDiagramGraph class.

:param filepath: string with output filepath,
:param bpmn_diagram: an instance of BpmnDiagramGraph class.