The simple answer is:
<xsl:for-each select="attribute">
But I suspect you're having some difficulty that you haven't explained - you haven't said what you tried, so it's hard to tell you where you went wrong. Perhaps you were having difficulty with the concept of a context node - but that's wild guesswork.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference