with-xmlnamespaces

Combine CTE "WITH" and a "WITH XMLNAMESPACES...." in SQL Server

Has anyone managed to create a CTE in SQL Server's T-SQL that also includes a WITH XMLNAMESPACES declaration? It seems both WITH keywords insist on being the "first in the T-SQL batch", and that doesn't really work.... I tried: WITH XMLNAMESPACES('http://schemas.myself.com/SomeSchema' as ns) WITH CTEQuery AS ( SELECT (list of fields) ...