void (final Element element) { List<Element> children = new ArrayList<>(element.getChildren(Constants.OPTION)); Set<String> names = new HashSet<>(); for (Element child : children) { if (!names.add(child.getAttributeValue(Constants.NAME))) { element.removeContent(child); } } }