final Configuration configuration = new Configuration();
configuration.addTemplateResolver(new ClassLoaderTemplateResolver());
configuration.addMessageResolver(new StandardMessageResolver());
configuration.setTemplateModeHandlers(StandardTemplateModeHandlers.ALL_TEMPLATE_MODE_HANDLERS);
configuration.initialize();
return getDOMFor(configuration, source, parser);
}