transformer.setOutputProperty(OutputKeys.INDENT, "yes");
StringWriter writer = new StringWriter();
transformer.transform(xmlSource, new StreamResult(writer));
return writer.toString();
} catch (TransformerConfigurationException e) {
throw new SoapException("Error during XML transformer configuration", e);
} catch (TransformerException e) {
throw new SoapException("Error during XML source transformation", e);
}
}