I got an XML like this on va variable prdxml
<category numberofproducts="0">
<id>catering</id>
<url>/products/kantine</url>
<name>Kantine</name>
<category numberofproducts="0">
<id>madembal</id>
<url>/products/mad-og-emballage</url>
<name>Mad og emballage</name>
<category numberofproducts="9">
<id>stanniol</id>
<url>/products/stanniol</url>
<name>Stanniol</name>
<category numberofproducts="9">
<id>stankd</id>
<url>/products/stankd</url>
<name>stankd</name>
</category>
</category>
<category numberofproducts="5">
<id>termo</id>
<url>/products/termobakker</url>
<name>Termobakker</name>
</category>
</category>
</category>
Now I want to get all the Id's present in this xml to a string.Tried usual for-each loop but failed,because of the structure of this xml. Now I thinks there may be a smarter way to achieve this ,that i never known.Can any one give me that light.