Actually, in xsl:attribute, there are two ways of indicating the namespace. You can use
<xsl:attribute name="foo:bar"/>
in which case foo must have been declared, or you can use
<xsl:attribute name="foo:bar" namespace="uri"/>
in which case foo does not need to have been declared, since the namespace URI is taken from the namespace attribute, and not from the namespace binding of foo.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference