}
protected Document renderTemplate(Template template) throws Exception {
Configuration conf = Configuration.getConfiguration();
Document doc = template.getDocumentClone();
doc.outputSettings().prettyPrint(conf.isOutputAsPrettyPrint());
InterceptorUtil.executeWithInterceptors(doc, WrapperPageInterceptorList, new Executor<Document>() {
@Override
public void execute(Document doc) throws Exception {
RenderUtil.applySnippets(doc);
RenderUtil.applyMessages(doc);