try out the following xslt
<xsl:template match="/*">
<Records>
<xsl:call-template name="oldData">
<xsl:with-param name="oData" select="OldList"/>
<xsl:with-param name="nData" select="NewList"/>
</xsl:call-template>
</Records>
</xsl:template>
<xsl:template name="oldData">
<xsl:param name="oData"/>
<xsl:param name="nData"/>
<xsl:variable name="ofirst" select="substring-before($oData,',')"/>
<xsl:variable name="olast" select="substring-after($oData,',')"/>
<xsl:variable name="nfirst" select="substring-before($nData,',')"/>
<xsl:variable name="nlast" select="substring-after($nData,',')"/>
<xsl:choose>
<xsl:when test="($ofirst!='') and ($nfirst!='')">
<record>
<Old>
<xsl:value-of select="$ofirst"/>
</Old>
<New>
<xsl:value-of select="$nfirst"/>
</New>
</record>
<xsl:call-template name="oldData">
<xsl:with-param name="oData" select="substring-after($oData,concat($ofirst,','))"/>
<xsl:with-param name="nData" select="substring-after($nData,concat($nfirst,','))"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$olast!='' and $nlast!=''">
<xsl:call-template name="oldData">
<xsl:with-param name="oData" select="$olast"/>
<xsl:with-param name="nData" select="$nlast"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<record>
<Old>
<xsl:value-of select="$oData"/>
</Old>
<New>
<xsl:value-of select="$nData"/>
</New>
</record>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Creating mutable variables in XSLT 1.0 is not an option. That can be however achieved by recursion. That is how the problem can be solved