```
<xsl:choose>
  <xsl:when test="type='LEVEL'">
    <xsl:variable name="myVar" select = "value"/>
      <xsl:variable name="spaces" select = "'&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0'"/>
      <xsl:value-of select="substring($spaces, 1, $myVar)"/>
   </xsl:when>

```

I have the above code in XSLT. myVar is a variable with values like (1 or 2 or 3).
I need to store the output of the following line of code in a variable and use it outside the when condition.

```
xsl:value-of select="substring($spaces, 1, $myVar)"/

```

I am not able to do it currently.
Could anyone suggest something ?