title: How to get a match from xml file that has regular expressions?
body: <p>I would like to get exactly one best match from one (first) input that has a sequence of elements by comparing it with a single element. This first input represents a config file in where the list of elements have attributes with strings, wild cards, or regular expressions, like:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;Config&gt;
      &lt;Entry fileName=&quot;SOAP_PO_Send.xml&quot; fileParent=&quot;in/orders&quot;&gt;TPM_ENTRY_0001&lt;/Entry&gt;
      &lt;Entry fileName=&quot;.*.xml&quot; fileParent=&quot;in/orders&quot;&gt;TPM_ENTRY_0002&lt;/Entry&gt;
      &lt;Entry fileName=&quot;SOAP_PO_Send.*&quot; fileParent=&quot;in/*&quot;&gt;TPM_ENTRY_0003&lt;/Entry&gt;
      &lt;Entry fileName=&quot;.*&quot; fileParent=&quot;in/*&quot;&gt;TPM_ENTRY_0004&lt;/Entry&gt;
  &lt;/Config&gt;
  </code></pre>
  <p>The second input has a single element with the same attributes, but these have just strings, like:</p>
  <pre><code>&lt;Entry fileName=&quot;SOAP_PO_Send.xml&quot; fileParent=&quot;in/orders&quot;/&gt;    
  </code></pre>
  <p>Based on the first example, the element value from first entry of the config input should be returned. This is: TPM_ENTRY_0001</p>
  <p>But if the second input is:</p>
  <pre><code>&lt;Entry fileName=&quot;SOAP_PO_Send.xml&quot; fileParent=&quot;in/pos&quot;/&gt; 
  </code></pre>
  <p>Then the third entry should be returned, which is: TPM_ENTRY_0003</p>
  <p>And, if the second input is:</p>
  <pre><code>&lt;Entry fileName=&quot;SOAP_Invoice.xml&quot; fileParent=&quot;in/invoice&quot;/&gt;    
  </code></pre>
  <p>Then I should get the fourth entry: TPM_ENTRY_0004</p>
  <p>Do you have any idea, how I can solve this issue via XSLT?</p>
  <p>Many thanks in advance.</p>
  <p>Kind regards,</p>
  <p>Gunther</p>