### Question:
SDNCRequestTasks { protected String getXmlElement(Document doc, String exp) throws Exception { TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); StringWriter writer = new StringWriter(); transformer.transform(new DOMSource(doc), new StreamResult(writer)); logger.debug(writer.getBuffer().toString()); XPath xPath = XPathFactory.newInstance().newXPath(); String result = xPath.evaluate(exp, doc); if (result == null || result.isEmpty()) { throw new Exception("XPath Failed to find element expression: " + exp); } return result; }  void createCorrelationVariables(DelegateExecution execution); void callSDNC(DelegateExecution execution); void processCallback(DelegateExecution execution); void handleTimeOutException(DelegateExecution execution);  }### Answer:
@Test public void getXmlElementTest() throws Exception { final String sdncResponse = new String(Files.readAllBytes(Paths.get("src/test/resources/__files/SDNC_Async_Request2.xml"))); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db; db = dbf.newDocumentBuilder(); Document doc = db.parse(new InputSource(new StringReader(sdncResponse))); String finalMessageIndicator = getXmlElement(doc, " String responseCode = getXmlElement(doc, "/input/response-code"); String responseMessage = getXmlElement(doc, "/input/response-message"); assertEquals("Y", finalMessageIndicator); assertEquals("200", responseCode); assertEquals("Success", responseMessage); }