title: WSO2 ESB calling parameterized endpoint Looping on Parameters
body: <p>In my usecase i have to chain two service calls. In particular:</p>
  
  <p>1) The first call returns an xml listing several IDs</p>
  
  <p>2) i have to iterate through the returned ID list and to make an ID parameterized service call for each id-item.</p>
  
  <p>3) Finally i have to collect a whole response made up of each single ID-service-response.</p>
  
  <p>Suppose the first service call returns a response like this one:</p>
  
  <pre><code>&lt;result&gt;     
      &lt;Link&gt;
          &lt;Id&gt;93451&lt;/Id&gt;
      &lt;/Link&gt;
      &lt;Link&gt;
          &lt;Id&gt;93450&lt;/Id&gt;
      &lt;/Link&gt;
      ...
  </code></pre>
  
  <p>The second step is to perform a series of calling to parameterized endpoint like this:</p>
  
  <pre><code>http://myEndpoint/entry/eutils/efetch.fcgi?db=pubmed&amp;rettype=abstract&amp;retmode=xml&amp;id=&lt;ID&gt;
  </code></pre>
  
  <p>each call of which returns an xml response like this:</p>
  
  <pre><code>&lt;response&gt;
      &lt;field1&gt;value1&lt;/field1&gt;
      &lt;field2&gt;value2&lt;/field2&gt;
      &lt;field3&gt;value3&lt;/field3&gt;
  &lt;response&gt;
  </code></pre>
  
  <p>I have to collect a whole response like this one:</p>
  
  <pre><code>&lt;finalResponse&gt;
      &lt;response&gt;
          &lt;field1&gt;value1&lt;/field1&gt;
          &lt;field2&gt;value2&lt;/field2&gt;
          &lt;field3&gt;value3&lt;/field3&gt;
      &lt;response&gt;
      &lt;response&gt;
          &lt;field1&gt;value1&lt;/field1&gt;
          &lt;field2&gt;value2&lt;/field2&gt;
          &lt;field3&gt;value3&lt;/field3&gt;
      &lt;response&gt;
      &lt;response&gt;
          &lt;field1&gt;value1&lt;/field1&gt;
          &lt;field2&gt;value2&lt;/field2&gt;
          &lt;field3&gt;value3&lt;/field3&gt;
      &lt;response&gt;
  &lt;/finalResponse&gt;
  </code></pre>
  
  <p>How can i do? Could you give me some example? Thanks</p>