title: How do I insert XML into another XML file with XSLT?
body: <p>I looked at this thread to find out how to insert XML into XML with XSLT <a href="https://stackoverflow.com/questions/862954/insert-xml-node-at-a-specific-position-of-an-existing-document">Insert XML node at a specific position of an existing document</a></p>
  
  <p>But I have a problem since I need to insert XML between two grand child nodes.
  For example I want to insert <code>&lt;s&gt;...&lt;/s&gt;</code> between <code>&lt;r&gt;...&lt;/r&gt;</code> and <code>&lt;t&gt;...&lt;/t&gt;</code> in this file</p>
  
  <pre><code>&lt;root&gt;
    &lt;child1&gt;
      &lt;a&gt;...&lt;/a&gt;
      &lt;r&gt;...&lt;/r&gt;
      &lt;t&gt;...&lt;/t&gt;
      &lt;z&gt;...&lt;/z&gt;
    &lt;/child1&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>to create this file</p>
  
  <pre><code>&lt;root&gt;
    &lt;child1&gt;
      &lt;a&gt;...&lt;/a&gt;
      &lt;r&gt;...&lt;/r&gt;
      &lt;s&gt;...&lt;/s&gt;
      &lt;t&gt;...&lt;/t&gt;
      &lt;z&gt;...&lt;/z&gt;
    &lt;/child1&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Thanks for your help.</p>