title: Aliasing a FOR XML PATH result
body: <p>I want to alias the output of the following:</p>
  
  <pre><code>-- Test table with some rubbish data
  DECLARE @Test TABLE
  (
      Names [varchar](20)
  )
  INSERT INTO @Test
  SELECT 'Simon'
  
  -- Query returns but with XML_&lt;GUID&gt; alias
  SELECT 
      Names
  FROM 
      @Test t 
  FOR XML PATH ('Test')
  </code></pre>
  
  <p>So rather than a column header of XML_GUID I want to give it an alias of say 'Test' for sake of argument. I can't seem to get it. Anyone know how? I tried following an example from here: <a href="http://social.msdn.microsoft.com/Forums/nl/sqlxml/thread/1605c722-6388-40ff-9ab5-a3817a1db81f" rel="noreferrer">http://social.msdn.microsoft.com/Forums/nl/sqlxml/thread/1605c722-6388-40ff-9ab5-a3817a1db81f</a> but I can't seem to get it to return. I always run into the error that says the is no name for column 1.</p>
  
  <p>Any help appreciated.</p>
  
  <p>Thanks,</p>
  
  <p>Simon </p>