Maps aren't supported in Saxon-HE, so you will have to find some other representation. You could of course construct an XML document of some kind, or you could return a list of strings in which the key/value pairs are represented as a single string in a microsyntax such as "key:value" which you then parse out in the XSLT code. For example:
List<StringValue> list = new ArrayList<StringValue>();
for (MapEntry m : map.entrySet()) {
list.add(new StringValue(m.getKey() + ":" + m.getValue());
}
return new SequenceExtent(list);