Grouping elements under a new node in xslt <p>I need to group some elements together and pull them together under a new element. </p> <p>Below is a sample record, I would like to group together the address information into an additional layer.</p> <p>Here is the original record -</p> <pre><code> &lt;Records&gt; &lt;People&gt; &lt;FirstName&gt;John&lt;/FirstName&gt; &lt;LastName&gt;Doe&lt;/LastName&gt; &lt;Middlename /&gt; &lt;Age&gt;20&lt;/Age&gt; &lt;Smoker&gt;Yes&lt;/Smoker&gt; &lt;Address1&gt;11 eleven st&lt;/Address1&gt; &lt;Address2&gt;app 11&lt;/Address2&gt; &lt;City&gt;New York&lt;/City&gt; &lt;State&gt;New York&lt;/State&gt; &lt;Status&gt;A&lt;/Status&gt; &lt;/People&gt; &lt;/Records&gt; </code></pre> <p>expected Result: I need to group address data under a new element as such -</p> <pre><code> &lt;Records&gt; &lt;People&gt; &lt;FirstName&gt;John&lt;/FirstName&gt; &lt;LastName&gt;Doe&lt;/LastName&gt; &lt;Middlename /&gt; &lt;Age&gt;20&lt;/Age&gt; &lt;Smoker&gt;Yes&lt;/Smoker&gt; &lt;Address&gt; &lt;Address1&gt;11 eleven st&lt;/address1&gt; &lt;Address2&gt;app 11&lt;/address2&gt; &lt;City&gt;New York&lt;/City&gt; &lt;State&gt;New York&lt;/State&gt; &lt;/Address&gt; &lt;Status&gt;A&lt;/Status&gt; &lt;/People&gt; &lt;/Records&gt; </code></pre> <p>Any help would be great! Thank you</p>