It would be useful when people say they "have a problem" if they say what the problem is. If I don't know what you've tried and what concepts you're struggling with, then it's hard to help you over your learning difficulties.
This is really a very simple problem:
<xsl:template match="details">
<detail>
<xsl:copy-of select="detail[1]/@*">
<xsl:copy-of select="detail/text"/>
</detail>
</xsl:template>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference