<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform"[/URL] xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:template match="/">
<xsl:call-template name="addTimes">
<xsl:with-param name="times" select="//time"/>
<xsl:with-param name="total" select="0"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="addTimes">
<xsl:param name="times"/>
<xsl:param name="total"/>
<xsl:choose>
<xsl:when test="$times">
<xsl:call-template name="addTimes">
<xsl:with-param name="times" select="msxsl:node-set($times)[position() > 1]"/>
<xsl:with-param name="total">
<xsl:variable name="mins">
<xsl:value-of select="substring-before($times[1], ':')"/>
</xsl:variable>
<xsl:variable name="secs">
<xsl:value-of select="substring-after($times[1], ':')"/>
</xsl:variable>
<xsl:value-of select="$total + $secs + ($mins * 60)"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="hrs">
<xsl:value-of select="floor($total div 3600)"/>
</xsl:variable>
<xsl:variable name="mins">
<xsl:value-of select="floor(($total mod 3600) div 60)"/>
</xsl:variable>
<xsl:variable name="secs">
<xsl:value-of select="($total mod 3600) mod 60"/>
</xsl:variable>
<xsl:value-of select="concat($hrs, ':', format-number($mins, '00'), ':', format-number($secs, '00'))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>