public static Document getDocumentFromSource(Source source) throws ProcessingException, ConfigurationException { try { Transformer transformer = TransformerUtil.getTransformer(); DOMResult result = new DOMResult(); TransformerUtil.transform(transformer, source, result); return (Document) result.getNode(); } catch (ParsingException te) { throw logger.processingError(te); } }