I have slightly changed the parameter value to pass in the language codes:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions"
exclude-result-prefixes="xs fn">
<xsl:param name="language-codes" as="xs:string*" select="'DE', 'FR', 'RU'"/>
<xsl:variable name="lang-regex" select="concat('\[(', string-join($language-codes, '|'), ')\]')"/>
<xsl:output method="html" indent="yes"/>
<xsl:template match="MT[@N='NonEnglishAbstract']">
<xsl:variable name="matches">
<xsl:analyze-string select="@V" regex="{$lang-regex}">
<xsl:matching-substring>
<p class="{regex-group(1)}"/>
</xsl:matching-substring>
<xsl:non-matching-substring>
<value><xsl:value-of select="."/></value>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:variable>
<xsl:for-each select="$matches/p">
<p class="{@class}">
<xsl:value-of select="following-sibling::value[1]"/>
</p>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>