XMLSerializer ser;
_format = new OutputFormat( Method.XML, _response.getCharacterEncoding(), false );
ser = new XMLSerializer( _format );
ser.setOutputCharStream( getWriter() );
_resultHandler = new ResultHandlerAdapter(ser.asDocumentHandler());
} else {
Serializer ser;
_format.setEncoding( _response.getCharacterEncoding() );
ser = SerializerFactory.getSerializerFactory( _format.getMethod() ).makeSerializer( _format );
ser.setOutputCharStream( getWriter() );
_resultHandler = new ResultHandlerAdapter(ser.asDocumentHandler());
}
_response.setContentType( "text/" + _format.getMethod() );
if ( _stylesheet != null ) {
SAXInput saxInput = new SAXInput();