public TemplateFactory newTemplateFactory(String template, String encoding, TemplateModifier modifier, ExpressionLanguage expressionLanguage) throws TemplateLoadingException {
InputStream in = classLoader.getResourceAsStream(template);
TemplateDocument doc = parseTemplate(in, encoding, expressionLanguage);
modifier.modifyTemplate(doc);
try {
FragmentList fragments = doc.normalize();
return new ImmutableTemplateFactory(this, fragments);
} catch (BehaviorInstantiationException e) {
throw new TemplateLoadingException(e);
}
}