class SDNCServiceRequestConnector extends SDNCConnector {

    public SDNCResponseCommon parseResponseContent(String responseContent)
            throws ParseException, ParserConfigurationException, SAXException, IOException {

        // Note: this document builder is not namespace-aware, so namespaces are ignored.
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        documentBuilderFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
        documentBuilderFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
        documentBuilderFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
        InputSource source = new InputSource(new StringReader(responseContent));
        Document doc = documentBuilderFactory.newDocumentBuilder().parse(source);

        // Find the configuration-response-common child under the root element.
        // The root element is expected to be an "output" element, but we don't really care.

        Element root = doc.getDocumentElement();
        Element configurationResponseCommon = null;

        for (Element child : SDNCAdapterUtils.childElements(root)) {
            if ("configuration-response-common".equals(child.getNodeName())) {
                configurationResponseCommon = child;
                break;
            }
        }

        if (configurationResponseCommon == null) {
            throw new ParseException("No configuration-response-common element in SDNC response", 0);
        }

        // Process the children of configuration-response-common.

        String responseCode = null;
        String responseMessage = null;
        String svcRequestId = null;
        String ackFinalIndicator = null;
        List<Element> responseParameters = new ArrayList<>();

        for (Element child : SDNCAdapterUtils.childElements(configurationResponseCommon)) {

            switch (child.getNodeName()) {
                case "response-code":
                    responseCode = child.getTextContent();
                    break;
                case "response-message":
                    responseMessage = child.getTextContent();
                    break;
                case "svc-request-id":
                    svcRequestId = child.getTextContent();
                    break;
                case "ack-final-indicator":
                    ackFinalIndicator = child.getTextContent();
                    break;
                case "response-parameters":
                    responseParameters.add(child);
                    break;
                default:
            }
        }

        // svc-request-id is mandatory.

        if (svcRequestId == null || svcRequestId.isEmpty()) {
            throw new ParseException("No svc-request-id in SDNC response", 0);
        }

        // response-code is mandatory.

        if (responseCode == null || responseCode.isEmpty()) {
            throw new ParseException("No response-code in SDNC response", 0);
        }

        // ack-final-indicator is optional: default to "Y".

        if (ackFinalIndicator == null || ackFinalIndicator.trim().isEmpty()) {
            ackFinalIndicator = "Y";
        }

        if (!"Y".equals(ackFinalIndicator) && !"N".equals(ackFinalIndicator)) {
            throw new ParseException("Invalid ack-final-indicator in SDNC response: '" + ackFinalIndicator + "'", 0);
        }

        // response-message is optional. If the value is empty, omit it from the response object.

        if (responseMessage != null && responseMessage.isEmpty()) {
            responseMessage = null;
        }

        // If the response code in the message from SDNC was not 2XX, return SDNCServiceError.

        if (!responseCode.matches("2[0-9][0-9]") && !("0").equals(responseCode)) {
            // Not a 2XX response. Return SDNCServiceError.
            return new SDNCServiceError(svcRequestId, responseCode, responseMessage, ackFinalIndicator);
        }

        return createSDNCServiceResponse(responseCode, responseMessage, svcRequestId, ackFinalIndicator,
                responseParameters);

    }

}