The best way to improve the efficiency of this code is probably to replace the expression /etd/entities/entity/data[@class=$CA_entity] with key('k', $CA_entity), having first declared
<xsl:key name="k" match="/etd/entities/entity/data" use="@class"/>
There's no reason to believe that the template calling should be inefficient, although of course that may be true for some implementations. You may not like the verbosity of the template calls, but that's a different matter. In 2.0 you can replace these with function calls.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference