You need to do it in two steps (that is, define an intermediate type which you don't actually need): first an extension to add the attribute, then a restriction to restrict the content. Or vice versa.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference