Here's a solution. This is a situation where a recursive call template works pretty well. The basic idea is to start at the deepest level of "DIMENSION_Id" and work you way up the tree. So the call template is invoked with the deepest context, then it calls itself with the parent context, and so on until it reaches the root document node.
As it's doing this it is continuously building the string that is your URL. Feel free to tweak it as needed. If you don't want to start at the deepest, just call it with whatever context you want to start at. Keep in mind this solution is strictly for a structure of elements that are nested within themselves.
Input Document
<DIMENSION_Id>
<SYN>1Text</SYN>
<SYN>1</SYN>
<DIMENSION_Id>
<SYN>2Text</SYN>
<SYN>2</SYN>
<DIMENSION_Id>
<SYN>3Text</SYN>
<SYN>3</SYN>
<DIMENSION_Id>
<SYN>4Text</SYN>
<SYN>4</SYN>
<DIMENSION_Id>
<SYN>5Text</SYN>
<SYN>5</SYN>
</DIMENSION_Id>
</DIMENSION_Id>
</DIMENSION_Id>
</DIMENSION_Id>
</DIMENSION_Id>
Here's the transformation.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:call-template name="getPath">
<!-- This XPath gets the "deepest" DIMENSION_Id element node in the tree -->
<xsl:with-param name="currentnode" select="//DIMENSION_Id[count(ancestor::*) = max(count(//DIMENSION_Id/ancestor::*))]"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="getPath">
<xsl:param name="currentnode"/>
<xsl:param name="currenttext" select="''" />
<xsl:choose>
<xsl:when test="count($currentnode/ancestor::*) = 0">
<xsl:value-of select="concat($currentnode/SYN[1],$currenttext)"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="gettext" >
<xsl:text>/</xsl:text>
<xsl:value-of select="$currentnode/SYN[1]"/>
</xsl:variable>
<xsl:call-template name="getPath" >
<xsl:with-param name="currentnode" select="$currentnode/.." />
<xsl:with-param name="currenttext" select="concat($gettext,$currenttext)" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
This is the output.
1Text/2Text/3Text/4Text/5Text