title: How to sort the xml element based on data in wso2esb
body: <p>I am using wso2esb.
  I wish to transform the data using wso2esb i have done the issue is while response i am getting data in descending manner how would i arrange in to ascending way .</p>
  
  <pre><code>&lt;response&gt;
      &lt;customer-details&gt;
          &lt;cusfirstname&gt;Empire Burlesque&lt;/cusfirstname&gt;
          &lt;delarname&gt;Bob Dylan&lt;/delarname&gt;
          &lt;cusno&gt;254&lt;/cusno&gt;
      &lt;/customer-details&gt;
      &lt;customer&gt;
          &lt;cusId&gt;6&lt;/cusId&gt;
          &lt;customername&gt;Bonnie Tyler&lt;/customername&gt;
          &lt;country&gt;UK&lt;/country&gt;
          &lt;company&gt;CBS Records&lt;/company&gt;
          &lt;price&gt;9.90&lt;/price&gt;
          &lt;year&gt;1988&lt;/year&gt;
      &lt;/customer&gt;
      &lt;customer&gt;
          &lt;cusId&gt;8&lt;/cusId&gt;
          &lt;customername&gt;Dolly Parton&lt;/customername&gt;
          &lt;country&gt;USA&lt;/country&gt;
          &lt;company&gt;RCA&lt;/company&gt;
          &lt;price&gt;9.90&lt;/price&gt;
          &lt;year&gt;1982&lt;/year&gt;
      &lt;/customer&gt;
      &lt;customer&gt;
          &lt;cusId&gt;3&lt;/cusId&gt;
          &lt;customername&gt;Gary Moore&lt;/customername&gt;
          &lt;country&gt;UK&lt;/country&gt;
          &lt;company&gt;Virgin records&lt;/company&gt;
          &lt;price&gt;10.20&lt;/price&gt;
          &lt;year&gt;1990&lt;/year&gt;
      &lt;/customer&gt;
      &lt;customer&gt;
          &lt;cusId&gt;5&lt;/cusId&gt;
          &lt;customername&gt;Eros Ramazzotti&lt;/customername&gt;
          &lt;country&gt;EU&lt;/country&gt;
          &lt;company&gt;BMG&lt;/company&gt;
          &lt;price&gt;9.90&lt;/price&gt;
          &lt;year&gt;1997&lt;/year&gt;
      &lt;/customer&gt;
      &lt;customer&gt;
          &lt;cusId&gt;7&lt;/cusId&gt;
          &lt;customername&gt;Bee Gees&lt;/customername&gt;
          &lt;country&gt;UK&lt;/country&gt;
          &lt;company&gt;Polydor&lt;/company&gt;
          &lt;price&gt;10.90&lt;/price&gt;
          &lt;year&gt;1998&lt;/year&gt;
      &lt;/customer&gt;
      &lt;customer&gt;
          &lt;cusId&gt;1&lt;/cusId&gt;
          &lt;customername&gt;Dr.Hook&lt;/customername&gt;
          &lt;country&gt;UK&lt;/country&gt;
          &lt;company&gt;CBS&lt;/company&gt;
          &lt;price&gt;8.10&lt;/price&gt;
          &lt;year&gt;1973&lt;/year&gt;
      &lt;/customer&gt;
      &lt;customer&gt;
          &lt;cusId&gt;2&lt;/cusId&gt;
          &lt;customername&gt;Rod Stewart&lt;/customername&gt;
          &lt;country&gt;UK&lt;/country&gt;
          &lt;company&gt;Pickwick&lt;/company&gt;
          &lt;price&gt;8.50&lt;/price&gt;
          &lt;year&gt;1990&lt;/year&gt;
      &lt;/customer&gt;
      &lt;customer&gt;
          &lt;cusId&gt;4&lt;/cusId&gt;
          &lt;customername&gt;Andrea Bocelli&lt;/customername&gt;
          &lt;country&gt;EU&lt;/country&gt;
          &lt;company&gt;Polydor&lt;/company&gt;
          &lt;price&gt;10.80&lt;/price&gt;
          &lt;year&gt;1996&lt;/year&gt;
      &lt;/customer&gt;
      &lt;customer&gt;
          &lt;cusId&gt;12&lt;/cusId&gt;
          &lt;customername&gt;Percy Sledge&lt;/customername&gt;
          &lt;country&gt;USA&lt;/country&gt;
          &lt;company&gt;Atlantic&lt;/company&gt;
          &lt;price&gt;8.70&lt;/price&gt;
          &lt;year&gt;1987&lt;/year&gt;
      &lt;/customer&gt;
      &lt;customer&gt;
          &lt;cusId&gt;9&lt;/cusId&gt;
          &lt;customername&gt;Savage Rose&lt;/customername&gt;
          &lt;country&gt;EU&lt;/country&gt;
          &lt;company&gt;Mega&lt;/company&gt;
          &lt;price&gt;10.90&lt;/price&gt;
          &lt;year&gt;1995&lt;/year&gt;
      &lt;/customer&gt;
      &lt;customer&gt;
          &lt;cusId&gt;11&lt;/cusId&gt;
          &lt;customername&gt;Many&lt;/customername&gt;
          &lt;country&gt;USA&lt;/country&gt;
          &lt;company&gt;Grammy&lt;/company&gt;
          &lt;price&gt;10.20&lt;/price&gt;
          &lt;year&gt;1999&lt;/year&gt;
      &lt;/customer&gt;
      &lt;customer&gt;
          &lt;cusId&gt;10&lt;/cusId&gt;
          &lt;customername&gt;Kenny Rogers&lt;/customername&gt;
          &lt;country&gt;UK&lt;/country&gt;
          &lt;company&gt;Mucik Master&lt;/company&gt;
          &lt;price&gt;8.70&lt;/price&gt;
          &lt;year&gt;1995&lt;/year&gt;
      &lt;/customer&gt;
  &lt;/response&gt;
  </code></pre>
  
  <p>I wish to arrange the <strong>customer</strong> tag data in ascending order based on <strong>cusId</strong> so how would i arrange this I tried with xquery but i couldn't find the any function regarding element sorting , cusId should be appear  in 1,2,3,... </p>
  
  <p>How would i achieve this i know there is no function in xpath for this.</p>
  
  <p>thanks in advance.</p>