ByteArrayInputStream originalXmlInputStream = null;
try {
originalXmlInputStream = new ByteArrayInputStream(xml.getBytes(encoding));
xmlProcessor.setOriginalXml(originalXmlInputStream);
} catch (JDOMException e) {
throw new FailureException(errorMsg + xml, e);
} catch (IOException e) {
throw new FailureException(errorMsg + xml, e);
} finally {
IOUtils.closeQuietly(originalXmlInputStream);
}
}