All this xsl:element and xsl:attribute stuff will work, but XSLT is already verbose enough without making it worse. Why not write this as
<wrapper>
<xsl:text>#x0A;</xsl:text>
<xsl:for-each-group select="//city" group-by="@name">
<xsl:text>#x0A;</xsl:text>
<city name="{current-grouping-key()}">
<xsl:for-each select="current-group()">
<xsl:text>#x0A;</xsl:text>
<xsl:copy-of select="place"/>
</xsl:for-each>
<xsl:text>#x0A;</xsl:text>
</city>
</xsl:for-each-group>
<xsl:text>#x0A;</xsl:text>
</wrapper>
And you can probably simplify further by getting rid of the explicit newlines and relying on xsl:output indent="yes" instead.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference