// use a stylesheet if specified in query parameters
if (stylesheet != null) {
serializer.setStylesheet(resource, stylesheet);
}
serializer.setProperties(outputProperties);
serializer.prepareStylesheets(resource);
if (asMimeType != null) { // was a mime-type specified?
response.setContentType(asMimeType + "; charset=" + encoding);
} else {
if (serializer.isStylesheetApplied()