<xsl:stylesheet version="2.0" 
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:f="http://fxsl.sf.net/"
 exclude-result-prefixes="f"
>
  <xsl:import href="func-apply.xsl"/>
  
  <xsl:function name="f:compose">
    <xsl:param name="pFun1" as="element()"/>
    <xsl:param name="pFun2" as="element()"/>
    <xsl:param name="arg1"/>
    
    <xsl:sequence select=
     "f:apply($pFun1, f:apply($pFun2, $arg1))"
    />
  </xsl:function>
</xsl:stylesheet>