This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
XML (Schema) has no idea what a HashMap is. However from a data perspective it is nothing but a list of pairs where each pair has a unique key and an associated value (in Java the pair is java.util.Map.Entry). So that data can easily be structured like:
This internal structure is exposed as a Set<Map.Entry<K,V>> through java.util.HashMap.entrySet(). java.util.Set.toArray() can then turn it into a array of Map.Entry<K,V> for which it shouldn't be too difficult to set up a mapping.
Of course you could simply put the Hashmap inside of a container class as JAXB can handle a HashMap as a return value from a bean - it just can't deal with it as a top level object. Mapping your favorite class (HashMap)