I whant to loop through a XML file thats look like this:
<node>
<cd name="td1">
<data value="cd1-0" />
<cd name="td2">
<data value="cd1-1" />
</cd>
<cd name="td3">
<data value="cd1-2" />
</cd>
</cd>
<cd name="td4">
<data value="cd2-0" />
</cd>
</node>
This is the result that i what is this.
<html>
<table border="1">
<tr>
<td>cd1-0</td>
<td></td>
</tr>
<tr>
<td></td>
<td>cd1-1</td>
</tr>
<tr>
<td></td>
<td>cd1-2</td>
</tr>
<tr>
<td>cd2-0</td>
<td></td>
</tr>
</table>
</html>
In this examle I have 2 levels on the node cd
. But the level can be infinite. So i need some sort of recursive loop function.