public static List<Element> removeChildren(final Element element, Predicate<? super Element> filter) {
    List<Element> toRemove = new ArrayList<>();
    final List<Element> list = element.getChildren();
    for (Element e : list) {
      if (filter.test(e)) {
        toRemove.add(e);
      }
    }
    for (Element e : toRemove) {
      element.removeContent(e);
    }
    return toRemove;
  }
public static List<Element> removeChildren(final Element element, Predicate<? super Element> filter)