@Override
  public Element getState() {
    Element element = new Element("state");
    for (Element template : myUnloadedTemplates) {
      element.addContent(template.clone());
    }
    for (Map.Entry<String, Collection<PostfixTemplate>> entry : myTemplates.entrySet()) {
      for (PostfixTemplate template : entry.getValue()) {
        PostfixTemplateProvider provider = template.getProvider();
        if (provider != null) {
          if (template instanceof PostfixChangedBuiltinTemplate changedBuiltinTemplate) {
            String builtin = changedBuiltinTemplate.getBuiltinTemplate().getId();
            element.addContent(writeTemplate(changedBuiltinTemplate.getDelegate(), provider, builtin));
          }
          else {
            element.addContent(writeTemplate(template, provider, null));
          }
        }
      }
    }
    return element;
  }
@Override
  public Element getState()