title: Concatenate multiple node values in xpath
body: <p>I have a XML that looks like this</p>
  
  <pre><code>&lt;element1&gt;
      &lt;element2&gt;
          &lt;element3&gt;    
              &lt;element4&gt;Hello&lt;/element4&gt;
              &lt;element5&gt;World&lt;/element5&gt;
          &lt;/element3&gt;
          &lt;element3&gt;    
              &lt;element4&gt;Hello2&lt;/element4&gt;
              &lt;element5&gt;World2&lt;/element5&gt;
          &lt;/element3&gt;
          &lt;element3&gt;    
              &lt;element4&gt;Hello3&lt;/element4&gt;
              &lt;element5&gt;World3&lt;/element5&gt;
          &lt;/element3&gt;
      &lt;/element2&gt;
  &lt;/element1&gt;
  </code></pre>
  
  <p>I am trying to use Xpath to get a result like this:</p>
  
  <pre><code>Hello.World
  Hello2.World2
  Hello3.World3
  </code></pre>
  
  <p>I used concat function below but I did not get correct result.</p>
  
  <p>Concat function:</p>
  
  <pre><code>concat(/element1/element2/element3/element4/text(),".", /element1/element2/element3/element5/text())
  </code></pre>
  
  <p>Result I got:</p>
  
  <pre><code>Hello.World
  </code></pre>
  
  <p>How can I get the correct result?
  I am using XPath with Camel Spring DSL.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Solutions in XQuery, XSLT and SPel are also appreciated.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I tried string-join and it did not work:</p>
  
  <p>string-join function:</p>
  
  <pre><code>string-join((/element1/element2/element3/element4/text(), /element1/element2/element3/element5/text()),".")
  </code></pre>
  
  <p>Result I got:</p>
  
  <pre><code>Hello.Hello2.Hello3.World.World2.World3
  </code></pre>