Hi,
You can set a context variable with the following:
<dp:set-variable name="'var://context/yourContext/yourVariableName'" value="string($someVar)"/>
and retrieve the value with the following:
<xsl:variable name="yourVar" select="dp:variable('var://context/yourContext/yourVariableName')" />