/** * Returns the value of the attribute with the given name. * * @return a {@link Value} filled with the attribute value if an attribute exists for the given name, an empty {@link Value} otherwise. */ @Nonnull public Value getAttribute(String name) { NamedNodeMap attributes = getNode().getAttributes(); if (attributes != null) { Node attribute = attributes.getNamedItem(name); if (attribute != null) { return Value.of(attribute.getNodeValue()); } } return Value.EMPTY; }