private String findFirstAttributeValue(XMLStreamReader reader, String name) {
        for (int i = 0; i < reader.getAttributeCount(); i++) {
            String n = reader.getAttributeLocalName(i);
            if (name.equals(n)) {
                return reader.getAttributeValue(i);
            }
        }
        return "";
    }
This class offers an initial capability to
scrape text containing elements out of XFA, and
it tries to link fields with values.
<p>
Some areas for improvement:
<ol>
    <li>convert this to 2 lines of XPath</li>
    <li>handle metadata stored in &lt;desc&gt; section (govdocs1: 754282.pdf, 982106.pdf)</li>
    <li>handle pdf metadata (access permissions, etc.) in &lt;pdf&gt; element</li>
    <li>extract different types of uris as metadata</li>
    <li>add extraction of &lt;image&gt; data (govdocs1: 754282.pdf)</li>
    <li>add computation of traversal order for fields</li>
    <li>figure out when text extracted from xfa fields is duplicative of that
    extracted from the rest of the pdf...and do this efficiently and quickly</li>
    <li>avoid duplication with &lt;speak&gt; and &lt;tooltip&gt; elements</li>
</ol>
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-pdf-module/src/main/java/org/apache/tika/parser/pdf/XFAExtractor.java