title: custom xml and sql server
body: <p>I have created xml from sql server 2008.
  My Current xml  is generated using "FOR XML AUTO"</p>
  
  <pre><code>&lt;Customer Name="john" City="Mumbai"&gt;
    &lt;Project Project_Name="pqr" /&gt;
  &lt;/Customer&gt;
  &lt;Customer Name="Rocky" City="Delhi"&gt;
    &lt;Project Project_Name="abc" /&gt;
    &lt;Project Project_Name="lmn" /&gt;
  &lt;/Customer&gt;
  </code></pre>
  
  <p>But I want  the output like</p>
  
  <pre><code>&lt;Customer &gt;
     &lt;name&gt;John&lt;/name&gt;
     &lt;city&gt;Mumbai&lt;/city&gt;  
     &lt;Projects&gt;
        &lt;project&gt;
           &lt;Project_Name&gt;pqr&lt;/Project_Name&gt;
        &lt;/project&gt;
     &lt;/Projects&gt;
  &lt;/Customer&gt;
  &lt;Customer &gt;
     &lt;name&gt;Rocky&lt;/name&gt;
     &lt;city&gt;Delhi&lt;/city&gt;  
     &lt;Projects&gt;
        &lt;project&gt;
           &lt;Project_Name&gt;abc&lt;/Project_Name&gt;
          &lt;Project_Name&gt;lmn&lt;/Project_Name&gt;
        &lt;/project&gt;
     &lt;/Projects&gt;
  &lt;/Customer&gt;
  </code></pre>
  
  <p>So basically i want to convert attributes of the parent element to sub-elements. And want additional customize elements. Please help me.</p>
  
  <p>Thanks in Advance.</p>