title: For XML Union with a temp table
body: <p>I know how to do union's and spit out an XML file from different tables, however, I need to create  a temp table that will house 3 records that I need to be a part of the XML File. The structure is exactly the same as the other tables. </p>
  
  <p>How would I go about doing this?</p>
  
  <pre class="lang-sql prettyprint-override"><code>select * from
  (
    select ID_Number as [ID], CLAST as [name/last], CFIRST as [name/first], '' as extension]
    from dbo.users as a 
    union all
    select PID as [ID], NID as [name/last], NAME as [name/first],  PREF_TITLE as [extension] 
    from dbo.Person
  ) as a
  FOR XML PATH('employee'), ROOT('employees')
  </code></pre>
  
  <p>So I would need 3 lines of data, which will fill ID, name/last, name/first and extension.</p>
  
  <p>What would be the best recommendation? </p>