class OpenStackParser {

    public String[] parseCreatedNetworkResponse(String response)
                                                         throws OCCIException {
        String[] ret = new String[2];
        XPath xpath;
        SAXBuilder builder = new SAXBuilder();
        builder.setValidation(false);
        builder.setIgnoringElementContentWhitespace(true);
        Document xmldoc;
        Element id, status;
        
        log.info("[OpenStackParser] Parsing created network response...");
        try {
            xmldoc = builder.build(new StringReader(response));
            xpath = XPath.newInstance("//ns:id");
            xpath.addNamespace("ns", QUANTUMNAMESPACE);
            xpath.addNamespace("provider", PROVIDERNAMESPACE);
            xpath.addNamespace("quantum", QUANTUMNAMESPACE);
            xpath.addNamespace("router", ROUTERNAMESPACE);
            xpath.addNamespace("xsi", XSINAMESPACE);
            id = (Element)xpath.selectSingleNode(xmldoc);
            
            xpath = XPath.newInstance("//ns:status");
            xpath.addNamespace("ns", QUANTUMNAMESPACE);
            xpath.addNamespace("provider", PROVIDERNAMESPACE);
            xpath.addNamespace("quantum", QUANTUMNAMESPACE);
            xpath.addNamespace("router", ROUTERNAMESPACE);
            xpath.addNamespace("xsi", XSINAMESPACE);
            status = (Element)xpath.selectSingleNode(xmldoc);
            
            if (id != null && status != null) {
            	ret[0] = id.getValue();
            	ret[1] = status.getValue();
            } else {
            	OCCIException exception = new OCCIException();
                exception.setMessage(MALFORMEDRESPONSE);
                log.error(MALFORMEDRESPONSE);
                throw exception;
            }
        } catch (JDOMException e) {
            log.error(e.getMessage());
        } catch (IOException e) {
            log.error(e.getMessage());
        }
        log.debug("[OpenStackParser] Created network response parsed...");
        
        return ret;
    }

}