@NotNull
  protected PaletteGroup loadGroup(Element element) throws Exception {
    PaletteGroup group = createPaletteGroup(element.getAttributeValue(NAME));

    for (Element itemElement : element.getChildren(ITEM)) {
      MetaModel model = getModelByTag(itemElement.getAttributeValue(TAG));
      PaletteItem paletteItem = model.getPaletteItem();

      if (!itemElement.getChildren().isEmpty()) {
        // Replace the palette item shown in the palette; it might provide a custom
        // title, icon or creation logic (and this is done here rather than in the
        // default palette item, since when loading elements back from XML, there's
        // no variation matching. We don't want for example to call the default
        // LinearLayout item "LinearLayout (Horizontal)", since that item would be
        // shown in the component tree for any <LinearLayout> found in the XML, including
        // those which set orientation="vertical". In the future, consider generalizing
        // this such that the {@link MetaModel} can hold multiple {@link PaletteItem}
        // instances, and perform attribute matching.
        if (itemElement.getAttribute("title") != null) {
          paletteItem = createVariationPaletteItem(paletteItem, model, itemElement);
        }
        group.addItem(paletteItem);

        for (Element grandChild : itemElement.getChildren(ITEM)) {
          group.addItem(createVariationPaletteItem(paletteItem, model, grandChild));
        }
      }
      else {
        group.addItem(paletteItem);
      }
    }

    myPaletteGroups.add(group);

    return group;
  }
@NotNull
  protected PaletteGroup loadGroup(Element element)