### Question:
OgcXmlUtil { public static Document getDocumentFromString(String xml) throws IOException { Document document = null; try { InputSource source = new InputSource(new StringReader(xml)); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.parse(source); } catch (ParserConfigurationException | SAXException | IOException e) { throw new IOException("Could not parse input body " + "as XML: " + e.getMessage()); } return document; }  static String getRequestBody(HttpServletRequest request); static Document getDocumentFromString(String xml); static String getPathInDocument(Document document, String path); static NodeList getPathInDocumentAsNodeList(Document document, String path); static Element getDocumentElement(Document doc);  }### Answer:
@Test public void get_document_from_string() throws IOException { Document doc = OgcXmlUtil.getDocumentFromString(XML_STRING); assertNotNull(doc); }
@Test(expected = IOException.class) public void get_document_from_string_throws_exception() throws IOException { OgcXmlUtil.getDocumentFromString(CORRUPTED_XML_STRING); }