UPDATE: I\'ve discovered there is a Microsoft Connect item raised for this issue here
When using FOR XML PATH
An alternative solution I've seen is to add the XMLNAMESPACES declaration after building the xml into a temporary variable:
declare @xml as xml;
select @xml = (
select
a.c2 as "@species"
, (select l.c3 as "text()"
from t2 l where l.c2 = a.c1
for xml path('leg'), type) as "legs"
from t1 a
for xml path('animal'))
;with XmlNamespaces( 'uri:animal' as an)
select @xml for xml path('') , root('zoo');