title: XSLT - inner join type command for combining two functions
body: <p>I have two functions that are outputting XML data. Ideally I'd like to combine the outputs of each function into one variable to parse data.</p>
  
  <p>In SQL terms, each function can be joined together by an inner join via the attribute PageId... but joins are not permitted in XSLT (or at least to my knowledge).</p>
  
  <p>Any suggestions on the cleanest/easiest way to combine these functions? The functions I'm calling are built into the cms and cannot be edited. </p>
  
  <p>Some more information:</p>
  
  <p>The first function is the sitemap. It lists the webpage ids and their levels for the website.</p>
  
  <p>The second function pulls webpage ids and their metadata tags that I need combined with the site map.</p>
  
  <p>I thought about creating variables for the second function Page Ids, but the number of pages with the metadata tags changes and I don't believe the variables support dynamic names.</p>
  
  <p>I apologize if I'm not being clear enough as xslt is new to me. Please let me know if more information is needed.</p>
  
  <p>edit: adding code example</p>
  
  <pre><code>&lt;in:inputs xmlns:in="http://www.composite.net/ns/transformation/input/1.0"&gt;
    &lt;in:result name="SitemapXml"&gt;
      &lt;Page Id="a0a47ce1-6eba-4d29-a7a3-3749c768c7e7" isopen="true" xmlns=""&gt;
        &lt;Page Id="a3055286-0e90-4b04-99dd-fb1a61dde0bf" isopen='true' xmlns=""&gt;
          &lt;Page Id="da675b13-d4d3-42ab-acc1-82e2a5408100" isopen='true' iscurrent='true' Depth="2"/&gt;
        &lt;/Page&gt;
      &lt;/Page&gt;
    &lt;/in:result&gt;
    &lt;in:result name="GetisrootXml"&gt;
      &lt;isroot PageId="a0a47ce1-6eba-4d29-a7a3-3749c768c7e7" Id="f8d4eea4-7070-4bc3-a804-e106697ffaa9" isroot="true" xmlns=""/&gt;
      &lt;isroot PageId="f8e4adbc-2758-42d6-bc40-0192ba0107a6" Id="db62e132-3f3b-493f-917a-9e090f887f13" isroot="false" xmlns=""/&gt;
    &lt;/in:result&gt;
  &lt;/in:inputs&gt;
  </code></pre>
  
  <p>What I would like returned:</p>
  
  <pre><code>&lt;in:inputs xmlns:in="http://www.composite.net/ns/transformation/input/1.0"&gt;
    &lt;in:result name="SitemapXml"&gt;
      &lt;Page Id="a0a47ce1-6eba-4d29-a7a3-3749c768c7e7" isopen="true" xmlns="" isroot='true'&gt;
      &lt;/Page&gt;
      &lt;Page Id="a3055286-0e90-4b04-99dd-fb1a61dde0bf" isopen='true' xmlns=""&gt;
          &lt;Page Id="da675b13-d4d3-42ab-acc1-82e2a5408100" isopen='true' iscurrent='true' Depth="2"/&gt;
    &lt;/in:result&gt;
  &lt;/in:inputs&gt;
  </code></pre>
  
  <p>From this, I want to further change the output to fit my needs (add tags for display purposes). In order to get to that point, the isroot attribute needs to be attached to the sitemap.</p>