public static @Nullable Element reduceChildren(@NotNull String name, @NotNull Element parent) {
    List<Element> children = parent.getChildren(name);
    Iterator<Element> it = children.iterator();
    if (!it.hasNext()) {
      return null;
    }

    Element accumulator = it.next();
    while (it.hasNext()) {
      merge(accumulator, it.next());
      it.remove();
    }
    return accumulator;
  }
public static @Nullable Element reduceChildren(@NotNull String name, @NotNull Element parent)