I'm seeking some design advice relating to avoiding a potential performance issue.

Short version: Generally speaking, how much slower is querying a DOM using XPath than querying two hashmaps?

Longer and mpre specific version:

I'm creating a Java application which has to read an XML file as part of its start-up. The file will probably have a maximum of 8200 attributes configured as shown in the below XML. Theoretically there would be a maximum 100 mapping Elements each with 2 attributes. Each element containing 1 to 40 elements with pairs of attributes. So a total of (40 \* 2) \* 100 + 200 text attributes.

```
<mapping source="A" target="B">
    <field fname="" tname=""/>
    <field fname="" tname=""/>  
    <field fname="" tname=""/>  
    <field fname="" tname=""/>
</mapping>

```

It crossed my mind to extract the info into 2 hashmaps which will then be used to do lookups during the execution of the program. I'm only interested in finding the mapping "source" from which I will lookup both the corresponding "target" and then use any child "fname" to look up the corresponding "tname". 

I'm just wondering how much slower it would be to use XPath and query the DOM each time I want some information compared with creating a hashmap of (e.g.) a "mappings class" which itself contains a hashmap of fname/tname kv pairs... 

Thanks in advance for any tips and hope this makes sense.

Kevin