Code:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
version="1.0">
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="xsd:element/@name">
<xsl:attribute name="{name()}">
<xsl:value-of select="../xsd:annotation/xsd:documentation"/>
</xsl:attribute>
</xsl:template>
<xsl:template match="xsd:element/xsd:annotation/xsd:documentation">
<xsl:copy>
<xsl:value-of select="../../@name"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Untested but should give you an idea.