I was initially trying to create an xmlns attribute on the root element. This turns out to be the wrong approach. I found confirmation of this on the mulberrytech xslt list and xslt FAQ:
"What you can't do is to use xsl:attribute name="xmlns:xyz". Namespaces are not attributes."
"xmlns is NOT an attribute"
"namespace attributes show up on the namespace axis, not on the attribute axis."
Jeni Tennison suggests that
To create an html element with no prefix and in the XHTML namespace, you need to declare the XHTML namespace as the default namespace within your stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
Following this approach, I added the TEI namespace to the root of the stylesheet. Initially, I figured this wasn't working (looking at the document in Firefox, as it was rendered by Cocoon), and I hacked around for ages trying to figure out why there was no xmlns attribute; eventually I realized that you have to view the source of the page to see it, because in its default rendering of an XML document with no style, Firefox suppresses the xmlns attribute!