Element (@NotNull PostfixTemplate template, @NotNull PostfixTemplateProvider provider, @Nullable String builtinId) { Element templateElement = new Element(TEMPLATE_TAG); templateElement.setAttribute(ID_ATTR_NAME, template.getId()); templateElement.setAttribute(KEY_ATTR_NAME, template.getKey()); templateElement.setAttribute(PROVIDER_ATTR_NAME, provider.getId()); if (builtinId != null) { templateElement.setAttribute(BUILTIN_ATTR_NAME, builtinId); } provider.writeExternalTemplate(template, templateElement); return templateElement; }