Just figured this out to some degree. If you code:
if object_id('tempdb.dbo.#tmp') is not null drop table dbo.#tmp;
create table dbo.#tmp(x xml);
insert dbo.#tmp
select 1 [Number] for xml path('root')
it will fail with Msg 6819, however, the following will work!?!
if object_id('tempdb.dbo.#tmp') is not null drop table dbo.#tmp;
create table dbo.#tmp(x xml);
insert dbo.#tmp
select (select 1 [Number] for xml path('root'))