XSLT – copy node with attributes without childs

Simple solution for not-so-trivial problem of copying xml node with all its attributes, but without child nodes.

Without the last condition, solution is easy, one would use <xsl:copy-of>, but with it things are a bit harder, you should do smt. like:

<xsl:copy select="."> <!-- this copies element name -->
   <xsl:copy-of select="@*"/> <!-- this copies all its attributes -->

And thats all, seems easy but it took me some time to realize it (And I must do it myself, because google didn’t helped me !).