### Question:
XmlTool { public static String normalize(Object xml) throws IOException, TransformerException, ParserConfigurationException, SAXException, XPathExpressionException { if (xml == null) { return null; } Source xsltSource = new StreamSource(new StringReader(readResourceFile("normalize-namespaces.xsl"))); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); dbFactory.setNamespaceAware(true); dbFactory.setFeature("http: dbFactory.setFeature("http: DocumentBuilder db = dbFactory.newDocumentBuilder(); InputSource source = new InputSource(new StringReader(String.valueOf(xml))); Document doc = db.parse(source); XPath xPath = XPathFactory.newInstance().newXPath(); NodeList nodeList = (NodeList) xPath.evaluate(" for (int i = 0; i < nodeList.getLength(); ++i) { Node node = nodeList.item(i); node.getParentNode().removeChild(node); } TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); Transformer transformer = transformerFactory.newTransformer(xsltSource); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); transformer.setOutputProperty("{http: StringWriter writer = new StringWriter(); transformer.transform(new DOMSource(doc), new StreamResult(writer)); return writer.toString().trim(); } private  XmlTool(); static String normalize(Object xml); static String encode(Object value); static String removePreamble(Object xml); static String removeNamespaces(Object xml); static Optional<String> modifyElement(String xml, String elementTag, String newValue);  }### Answer:
@Test public void normalizeTest() throws Exception { String response = XmlTool.normalize(content); assertNotNull(response); }