title: xml xsl xpath transformation using wildcard on element
body: <p>I have a whack of unfriendly and half-baked xml files that resemble the following:</p>
  
  <pre><code>&lt;root&gt;
  &lt;child0&gt;&lt;name0&gt;Bob Dylan&lt;/name0&gt;&lt;/child0&gt;
  &lt;child1&gt;&lt;name1&gt;Daft Punk&lt;/name1&gt;&lt;/child1&gt;
  &lt;child2&gt;&lt;name2&gt;Nine Inch Nails&lt;/name2&gt;&lt;/child2&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>and i wish to transform each file into the following:</p>
  
  <pre><code>&lt;root&gt;&lt;children&gt;
  &lt;child&gt;&lt;name&gt;Bob Dylan&lt;/name&gt;&lt;/child&gt;
  &lt;child&gt;&lt;name&gt;Daft Punk&lt;/name&gt;&lt;/child&gt;
  &lt;child&gt;&lt;name&gt;Nine Inch Nails&lt;/name&gt;&lt;/child&gt; 
  &lt;/children&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>each file does not have a deterministic number of children. some have only <code>&lt;child0&gt;</code> while others have <code>&lt;child0&gt; ... &lt;child10&gt;</code>. the elements within children are also not determined, eg. name[0], etc.</p>
  
  <p>so i would like to walk through each child (perhaps with a wildcard or ends-with, or ??) to match the numeral that is always terminating the child and childs's child element.</p>
  
  <p>this doesnt work but something along the lines of:</p>
  
  <pre><code>&lt;xsl:for-each select="child*" &gt;
       &lt;child&gt;
       &lt;name&gt;&lt;xsl:value-of select="name[index]"&gt;&lt;/name&gt;
       &lt;/child&gt;
  &lt;/xsl:for-each&gt;
  </code></pre>
  
  <p>ive seen plenty of examples of select,if and match conditions that deal with selecting the content within a element (or an element by way of position or index)...
  because thats the way it should be done.</p>
  
  <p>but i have valid yet half-baked xml. </p>