Sort Order in retrieveXPathQuery map

What order should you build the sort map for the retrieveXPathQuery in a java action. When debugging it seems that the display order is, the last pair to be put in the map is the first to be displayed i.e. the sort order would be the the reverse of you put actions
1 answers

Java (Hash)Maps do not preserve any ordering, unless you are using a LinkedHashMap. They maintain the insertion order when iterating them.