How to refer node created by one template in XSLT at runtime from the calling template?
===

I have splitted one string key6='||1-LIW-3324|1-LIW-3325|1-LIW-3326|1-LIW-3327|1-LIW-4232' with seperator '|' thru one template named 'StringSplit'. 
I have called this 'StringSplit' template from another template. So each splitted value is stored in 'SeperatedLineItems'.
Now I want to refer each splitted node(SeperatedLineItems) in the calling template and want to compare each saperated/splitted noade with another variable . How can i do it.


Here is the code.
<?xml version='1.0'?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:java="http://xml.apache.org/xalan/java">
    
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
    
<xsl:variable name="key6">
        <xsl:value-of select="'||1-LIW-3324|1-LIW-3325|1-LIW-3326|1-LIW-3327|1-LIW-4232'"/>
    </xsl:variable>

    <xsl:template match="/">
        <xsl:variable name="check3">
            <xsl:value-of select="1-LIW-3"/>
        </xsl:variable>
    
        <myProj>
        <xsl:call-template name="StringSplit">
                <xsl:with-param name="val" select="$key6"/>
        </xsl:call-template>
        
		<!--here I want to compare "SeperatedLineItems" with $check3 -->                   
        <!--<xsl:variable name="con"> 
            <xsl:value-of select="contains($key6,$check3)"/> 
        </xsl:variable>-->        
        </myProj>
		
    </xsl:template>
 
    <xsl:template name="StringSplit">
        <xsl:param name="val" select="$key6"/>
        <!-- do a check to see if the input string (still) has a "|" in it -->
        <xsl:choose>
            <xsl:when test="contains($val, '|')">
                <!-- pull out the value of the string before the "|" delimiter -->
                <SeperatedLineItems>
                    <xsl:value-of select="substring-before($val, '|')"/>
                </SeperatedLineItems> 
                <!-- recursively call this template and pass in value AFTER the "|" delimiter -->
                <xsl:call-template name="StringSplit">
                    <xsl:with-param name="val" select="substring-after($val, '|')"/> 
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <!-- if there is no more delimiter values, print out the whole string -->
                <SeperatedLineItems>
                    <xsl:value-of select="$val"/>
                </SeperatedLineItems>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

</xsl:transform> 
