title: Getting values from nodes when the XPath itself is a text inside a node
body: <p>Simple problem: I have an XML file like this:</p>
  
  <pre><code>&lt;Locations&gt;
      &lt;Location&gt;/Simulation/@ID&lt;/Location&gt;
      &lt;Location&gt;/Simulation/Loans&lt;/Location&gt;
      &lt;Location&gt;/Simulation/Assets&lt;/Location&gt;
      &lt;Location&gt;/Simulation/BankAssets&lt;/Location&gt;
      &lt;Location&gt;/Simulation/RealEstates&lt;/Location&gt;
  &lt;/Locations&gt;
  </code></pre>
  
  <p>I also have a second XML file containing data which matches these XPath nodes. And I need to create an XSLT 1.0 without any scripting that can transform this data file to just generate a list of data that matches these nodes. Something like this:</p>
  
  <pre><code>&lt;Data&gt;
      &lt;Item Node="/Simulation/@ID"&gt;
          &lt;Value&gt;1&lt;/Value&gt;
          &lt;Value&gt;2&lt;/Value&gt;
          &lt;Value&gt;3&lt;/Value&gt;
      &lt;/Item&gt;
      &lt;Item Node="/Simulation/Loans"&gt;
          &lt;Value&gt;1024&lt;/Value&gt;
          &lt;Value&gt;555&lt;/Value&gt;
          &lt;Value&gt;0&lt;/Value&gt;
      &lt;/Item&gt;
  &lt;/Data&gt;
  </code></pre>
  
  <p>The number of Value nodes per item is unimportant. Nor is the relation between the values of different items important. Basically, the stylesheet is just meant to collect simple, statistical data to be summed up, averaged and whatever more.
  The list of locations van vary a lot, depending on what the user wants. This example is just some spoof data.</p>
  
  <p>Question: how to collect this information?</p>