There are a few things wrong here.
<xsl:variable name="xpath" select="." />
<xsl:variable name="xvalue" select="@type"/>
<xsl:call-template name="refer"/>
You declare two variables here and don't actually use them. You can't refer to variables declared in one template in a different one. You need to use parameters:
<xsl:call-template name="refer">
<xsl:with-param name="xpath" select="." />
<xsl:with-param name="xvalue" select="@type"/>
</xsl:call-template>
and then declare the params in the called template using <xsl:param>. Except that "." is passed to a called template implicitly, so you don't really need these params, because you can refer to their values in the called template as "." and "@type" respectively.
<xsl:template match="$xpath">
There's a temptation to imagine that wherever you use any construct in XSLT or XPath, you can replace it with a variable. I've even seen people try to write <$x>...</$x> to create an element whose name is in a variable. That's not the way it works. You can only use a variable in a place where you could write a value - for example a string in quotes, like 'abc', or a number like 7. In particular, you can't hold expressions or patterns in variables. If you have a variable containing a string and the string is actually an XPath expression, then you can evaluate the expression using saxon:evaluate() or similar constructs in other processors. There's no equivalent for match patterns.
<xsl:attribute name="Change">$xvalue</xsl:attribute>
In XSLT 2.0 you can write
<xsl:attribute name="Change" select="$xvalue"/>
In 1.0 it has to be
<xsl:attribute name="Change">
<xsl:value-of select="$xvalue"/>
</xsl:attribute>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference