Also ich würde es nicht so kompliziert machen und einen rekursiven template Mechanismus wählen. Eine einfach Lösung wäre doch:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/" name="Temp1">
<xsl:for-each select="descendant-or-self::value">
<xsl:choose>
<!-- teste auf vorhandene folgewert in gleichen knoten -->
<xsl:when test="following-sibling::value[position() = 1]">
<text x1="{.}" x2="{following-sibling::value[position() = 1]}"/>
</xsl:when>
<xsl:otherwise>
<!-- teste auf letzen wert, wenn true keine ausgabe -->
<xsl:if test="parent::Intervall/following-sibling::Intervall[position() = 1]/value[position() = 1]">
<text x1="{.}" x2="{parent::Intervall/following-sibling::Intervall[position() = 1]/value[position() = 1]}"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Gruß, Holge r