public static @Nullable <T extends DomElement> T findByName(@NotNull Collection<T> list, @NonNls @NotNull String name) {
    for (T element: list) {
      String elementName = element.getGenericInfo().getElementName(element);
      if (elementName != null && elementName.equals(name)) {
        return element;
      }
    }
    return null;
  }
public static @Nullable <T extends DomElement> T findByName(@NotNull Collection<T> list, @NonNls @NotNull String name)