<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" indent="yes" />

<!--  Change parameters here  -->
<xsl:variable name="d1">20010407</xsl:variable>
<xsl:variable name="d2">20010609</xsl:variable>
<!--                          -->

<xsl:template match="/">
  <html>
  <body>

    <h4 align="center">
       Total cost of all purchases =

      <xsl:apply-templates select= 
        "//POlist[PO[Id[substring-after(date,'//') &gt; $d1  and
                 substring-after(date,'//') &lt; $d2]]]" />
    </h4>

  </body>
  </html>
</xsl:template>

<xsl:template match="POlist"> 
  <xsl:value-of select = "sum(PO/Payment/Cost)" />
</xsl:template>

</xsl:stylesheet>
