}
private SimpleResponse makeResponseWithxml(Document doc) throws IOException {
//TODO MdM Shoudl probably use a StreamedResponse
ByteArrayOutputStream output = new ByteArrayOutputStream();
XmlWriter xmlWriter = new XmlWriter(output);
xmlWriter.write(doc);
xmlWriter.flush();
xmlWriter.close();
SimpleResponse response = new SimpleResponse();
response.setContentType("text/xml");
response.setContent(output.toByteArray());
return response;
}