• One small change needed

    <td><xsl:value-of select="sum(../../*/*/costs)" /></td>

    😎