7.2 Mstyle as Parent of Text

<mi>  
  <mstyle mathvariant="bold">div</mstyle>  
</mi>

into

<mi mathvariant="bold">div</mi>

<..math-mstyle script..>
 <set name="math-mstyle" >
    <.open xslt script.>
    <.math-mstyle templates.>
    <.close xslt script.>
 </set>
 <xslt name="." xml="." xsl="math-mstyle" />
-_-_-

<..math-mstyle templates..>
 <xsl:template match=" m:* [
       not(self::m:math)
     and
       child::m:mstyle[
            @mathvariant
          and
            child::text()
          and
            (count(child::m:*) = 0)
       ]
     and
       (count(child::m:*) = 1)
     and
       not(@mathvariant)
 ] " >
   <xsl:copy>
      <xsl:apply-templates select="@*" />
      <xsl:apply-templates select="m:mstyle/@*" />
      <xsl:apply-templates select="m:mstyle/text()" />
   </xsl:copy>
 </xsl:template>
-_-_-