public void loadRepositoryFromBioPAXGraphXML(String graphXML) {
    //System.out.println(graphXML);
    try {
        Document document = builder.parse(new InputSource(new StringReader(graphXML)));

        //  GraphData
        NodeList graphroots = document.getElementsByTagName("graphdata");
        Node graphroot = graphroots.item(0);
        NodeList graphElements = graphroot.getChildNodes();
        for (int i = 0; i < graphElements.getLength(); i++) {
            Node graphElement = graphElements.item(i);

            // GraphData/Molecules
            if (graphElement.getNodeName().equals("molecules")) {
                loadBioPAXMoleculesFromXMLNode(graphElement);
            }
            // GraphData/GenericProcesses
            else if (graphElement.getNodeName().equals("genericprocesses")) {
                loadBioPAXGenericProcessesFromXMLNode(graphElement);
            }
            // GraphData/Pathways
            else if (graphElement.getNodeName().equals("pathways")) {
                loadBioPAXPathwaysFromXMLNode(graphElement);
            }
            else if (graphElement.getNodeName().equals("Mappings")) {
                loadBioPAXMappingsFromXMLNode(graphElement);
            }
        }

    } catch (SAXException sxe) {
        // Error generated during parsing
        Exception x = sxe;
        if (sxe.getException() != null)
            x = sxe.getException();
        //x.printStackTrace();
        System.out.println("ERROR: SAXException, check PathCaseXMLParser.java");

    } catch (IOException ioe) {
        // I/O error
        //ioe.printStackTrace();
        System.out.println("ERROR: IOException, check PathCaseXMLParser.java");
    }
}