private Document stringToDocument(String s) {
try {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
return documentBuilder.parse(new ReaderInputStream(new StringReader(s)));
} catch (Exception e) {
throw new RuntimeException("Error occurred. Cause: " + e, e);
}
}