title: Flatten xml hierarchy using XSLT
body: <p>I would like to convert a nested xml to flatten xml using XSLT.</p>
  
  <p>Incoming xml Structure would be similar but the node names would change for the incoming xmls, so would like to handle in dynamically </p>
  
  <p>Sample input    </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;queryResponse&gt;
    &lt;Account&gt;
      &lt;Id&gt;0010&lt;/Id&gt;
      &lt;Name&gt;AA&lt;/Name&gt;
      &lt;RecordTypeId&gt;0122/RecordTypeId&gt;
      &lt;RecordType&gt;
        &lt;Id&gt;012&lt;/Id&gt;
        &lt;DeveloperName&gt;Legal_Associate&lt;/DeveloperName&gt;
      &lt;/RecordType&gt;
    &lt;/Account&gt;
    &lt;Account&gt;
      &lt;Id&gt;0011&lt;/Id&gt;
      &lt;Name&gt;BB&lt;/Name&gt;
      &lt;RecordTypeId&gt;0123&lt;/RecordTypeId&gt;
      &lt;RecordType&gt;
        &lt;Id&gt;013&lt;/Id&gt;
        &lt;DeveloperName&gt;Legal_Associate&lt;/DeveloperName&gt;
      &lt;/RecordType&gt;
    &lt;/Account&gt;
   &lt;/queryResponse&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Expected Output</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;queryResponse&gt;
    &lt;Account&gt;
      &lt;Id&gt;0010&lt;/Id&gt;
      &lt;Name&gt;AA&lt;/Name&gt;
      &lt;RecordTypeId&gt;0122&lt;/RecordTypeId&gt;
      &lt;RecordType.Id&gt;012&lt;/RecordType.Id&gt;
    &lt;RecordType.DeveloperName&gt;Legal_Associate&lt;/RecordType.DeveloperName&gt;
    &lt;/Account&gt;
    &lt;Account&gt;
      &lt;Id&gt;0011&lt;/Id&gt;
      &lt;Name&gt;BB&lt;/Name&gt;
      &lt;RecordTypeId&gt;0123&lt;RecordTypeId&gt;
      &lt;RecordType.Id&gt;013&lt;/RecordType.Id&gt;    &lt;RecordType.DeveloperName&gt;Legal_Associate&lt;/RecordType.DeveloperName&gt;
      &lt;/Account&gt;
      &lt;/queryResponse&gt;</code></pre>
  </div>
  </div>
  </p>