private static @Nullable TemplateGroup parseTemplateGroup(@NotNull Element element,
                                                            @NonNls String defGroupName,
                                                            @NotNull ClassLoader classLoader) {
    if (!TEMPLATE_SET.equals(element.getName())) {
      LOG.error("Ignore invalid template scheme: " + JDOMUtil.writeElement(element));
      return null;
    }

    String groupName = element.getAttributeValue(GROUP);
    if (Strings.isEmpty(groupName)) {
      groupName = defGroupName;
    }

    LiveTemplateContextService ltContextService = LiveTemplateContextService.getInstance();
    TemplateGroup result = new TemplateGroup(groupName, element.getAttributeValue("REPLACE"));
    for (Element child : element.getChildren(TEMPLATE)) {
      try {
        result.addElement(readTemplateFromElement(groupName, child, classLoader, ltContextService));
      }
      catch (Exception e) {
        LOG.warn("failed to load template " + element.getAttributeValue(NAME), e);
      }
    }
    return result;
  }
private static @Nullable TemplateGroup parseTemplateGroup(@NotNull Element element,
                                                            @NonNls String defGroupName,
                                                            @NotNull ClassLoader classLoader)