FluentXML4J uses the builtin JDK XML parser and XPath API, but Java 8 is required because of heavy use of the streaming API and Optional.
<dependency>
<groupId>com.github.fluentxml4j</groupId>
<artifactId>fluentxml4j</artifactId>
<version>1.0.0</version>
</dependency>
Iterable<Element> elements =
from(doc)
.selectElements("//H1[text()='Some Title']");
Set<String> words =
from(doc)
.selectStrings("//text()")
.asStream()
.flatMap((s) -> Arrays.stream(s.split("[\\s\\t]+")))
.collect(Collectors.toSet());