// Set trasformation output properties
t.setOutputProperty(OutputKeys.ENCODING, response
.getCharacterEncoding());
// Create the trasformation source using our custom ObjectInputSource
InputSource inputSource = new ObjectInputSource(object);
Source source = new SAXSource(saxReader, inputSource);
// Create the trasformation result
// Result result = new StreamResult(response.getWriter());
Result result = new StreamResult(response.getOutputStream());