I know this is an old thread but it got me started on solving an issue and I thought I would put my results here for someone in the future.
We are using SharePoint 2010 Enterprise Search and for the results page I had the requirement of shortening the URL from the center and including the highlighting as well. The highlighting does not work when the URL is shortened however and there's probably an easier/better way to do this but this is what I did:
<span class="srch-URL2" id="{concat($currentId,'_Url')}" title="{$url}">
<xsl:call-template name="truncateURL">
<xsl:with-param name="targetURL">
<xsl:value-of select="url"/>
</xsl:with-param>
<xsl:with-param name="allowablelength" select="number(40)"/>
</xsl:call-template>
</span>
<xsl:template name="truncateURL">
<xsl:param name="targetURL"/>
<xsl:param name="allowablelength"/>
<xsl:choose>
<xsl:when test="string-length($targetURL) < $allowablelength">
<xsl:choose>
<xsl:when test="hithighlightedproperties/HHUrl[. != '']">
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="hithighlightedproperties/HHUrl" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$targetURL"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="string-length($targetURL) < ($allowablelength+$allowablelength)">
<xsl:choose>
<xsl:when test="hithighlightedproperties/HHUrl[. != '']">
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="hithighlightedproperties/HHUrl" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$targetURL"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($targetURL, 1, $allowablelength)"/>
<xsl:text>…</xsl:text>
<xsl:value-of select="substring($targetURL, (string-length($targetURL)-$allowablelength)+1, $allowablelength)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>