class XMLActions extends AbstractCaller {

    @Description("The generated XML will available by this reference in field `Content`<br>" +
            "Example:<br/>" +
            "#{ref.Content}")
    @CustomColumns(
            @CustomColumn(value = TEMPLATE, required = true)
    )
    @ActionMethod
    public HashMap<?, ?> generateDocument(IActionContext actionContext, HashMap<?, ?> inputData) {
        inputData = unwrapFilters(inputData);
        String templateAlias = Objects.requireNonNull((String) inputData.remove(TEMPLATE), "'template' parameter");

        IDataManager dataManager = actionContext.getDataManager();
        try (InputStream dataInputStream = dataManager.getDataInputStream(SailfishURI.parse(templateAlias))) {
            StringTemplateLoader stringLoader = new StringTemplateLoader();
            stringLoader.putTemplate(TEMPLATE, IOUtils.toString(dataInputStream, StandardCharsets.UTF_8));

            Configuration cfg = new Configuration(Configuration.VERSION_2_3_27);
            cfg.setTemplateLoader(stringLoader);

            Template temp = cfg.getTemplate(TEMPLATE);
            try (Writer out = new StringWriter()) {

                temp.process(inputData, out);

                HashMap<String, String> result = new HashMap<>();
                result.put(OUT, out.toString());
                return result;
            }
        } catch (Exception e) {
            throw new EPSCommonException(e);
        }
    }

}