Many JAXP implementations allow you to call Java methods on Java objects as extension functions, but the details depend on the product you are using (it's not defined in the JAXP interface itself). So consult your product documentation. In Saxon you could pass the HashMap directly as a parameter to the transformer and then access it as:
<xsl:param name="map"/>
...
<xsl:value-of select="Map:get($map, 'countryname')"
xmlns:Map="java:java.util.HashMap"/>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference