private void applyTemplate(Template template, SAXElement element, ExecutionContext executionContext) throws SmooksException {
if (getAction() == Action.BIND_TO) {
Writer writer = new StringWriter();
applyTemplate(template, element, executionContext, writer);
executionContext.getBeanContext().addBean(getBindBeanId(), writer.toString(), new Fragment(element));
} else {
Writer writer = element.getWriter(this);
applyTemplate(template, element, executionContext, writer);
}
}