/** * Returns the child element that has a given name and index. * * @param name The name. * @param index The index of the searched child element. * This index takes into account children that are elements and are named {@code name}. * @return The corresponding element or {@code null}. */ public default Element getElementNamedAt(String name, int index) { return Iterables.getAtOrNull(getElementsNamed(name), index); }
for (final Element child : getElementsNamed(name)) { switch (child.getContentType()) { case EMPTY: