I think the Java method must have returned unparsed lexical XML - if it had returned a node, then the xsl:value-of would have flattened the node, and the markup would have disappeared entirely rather than being escaped. So I suspect two changes are needed: (a) return a tree of nodes rather than lexical XML, and (b) use xsl:copy-of rather than xsl:value-of.
But I always wonder with this sort of thing whether escaping into Java is really needed anyway. A lot of people do it because they haven't yet learned what can be achieved in XSLT without extensions.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference