Slå in dina 2 val på en enda så här:
select (
select id, name from (
select id, name
from xmltest
UNION
select id, name
from xmltest
) A
FOR XML PATH ('AccountDetails'), root ('Root')
) As XmlOutput