public static Optional<String> attribute(String name, Element element) {
        if ( ! element.hasAttribute(name)) return Optional.empty();
        return Optional.of(element.getAttribute(name));
    }
Returns the given attribute name from element, or empty if the element does not have it.
vespajlib/src/main/java/com/yahoo/text/XML.java