replace xml root tag with attribute value using xslt
<p>Need XSLT code to convert XML root tag with attribute value:
My input XML is like as below:</p>

<pre><code>enter code here

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;?Siebel-Property-Set EscapeNames="false"?&gt;
&lt;Message IntObjectFormat="SH" MessageType="IO" IntObjectName="IO"     MessageId="1" MsgType="CreateService"&gt;
&lt;CreateServiceProvider&gt;
&lt;ServiceProvider&gt;
&lt;Id&gt;11&lt;/Id&gt;
&lt;AccountGroup&gt;FMLY&lt;/AccountGroup&gt;
&lt;Name&gt;rin&lt;/Name&gt;
&lt;Status&gt;Active&lt;/Status&gt;
&lt;ParentId/&gt;
&lt;MainPhoneNumber&gt;041&lt;/MainPhoneNumber&gt;
&lt;MainFaxNumber/&gt;
&lt;MainEmailAddress/&gt;
&lt;ABNCode/&gt;
&lt;PrimaryAddressStreetNo&gt;2&lt;/PrimaryAddressStreetNo&gt;
&lt;PrimaryAddressStreetName&gt;Marl&lt;/PrimaryAddressStreetName&gt;
&lt;StreetSuffix&gt;Pl&lt;/StreetSuffix&gt;
&lt;Postcode&gt;2558&lt;/Postcode&gt;
&lt;AddressCountry&gt;Austria/AddressCountry&gt;
&lt;/ServiceProvider&gt;
&lt;/CreateServiceProvider&gt;
&lt;/Message&gt;    
</code></pre>

<p>I need output as below where my Root tag name "Message" get converted into the value which I am getting in "MsgType" attribute.</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;?Siebel-Property-Set EscapeNames="false"?&gt;
&lt;CreateService IntObjectFormat="SH" MessageType="IO" IntObjectName="IO"    MessageId="1" MsgType="CreateService"&gt;
&lt;CreateServiceProvider&gt;
&lt;ServiceProvider&gt;
&lt;Id&gt;11&lt;/Id&gt;
&lt;AccountGroup&gt;FMLY&lt;/AccountGroup&gt;
&lt;Name&gt;rin&lt;/Name&gt;
&lt;Status&gt;Active&lt;/Status&gt;
&lt;ParentId/&gt;
&lt;MainPhoneNumber&gt;041&lt;/MainPhoneNumber&gt;
&lt;MainFaxNumber/&gt;
&lt;MainEmailAddress/&gt;
&lt;ABNCode/&gt;
&lt;PrimaryAddressStreetNo&gt;2&lt;/PrimaryAddressStreetNo&gt;
&lt;PrimaryAddressStreetName&gt;Marl&lt;/PrimaryAddressStreetName&gt;
&lt;StreetSuffix&gt;Pl&lt;/StreetSuffix&gt;
&lt;Postcode&gt;2558&lt;/Postcode&gt;
&lt;AddressCountry&gt;Austria/AddressCountry&gt;
&lt;/ServiceProvider&gt;
&lt;/CreateServiceProvider&gt;
&lt;/CreateService&gt;    
</code></pre>

<p>Thanks.</p>

<p>Regards,
AJ</p>