posted 14 years ago
I have a List in the structure mentioned below (its a List of HashMaps)
{TeamName=India, Name=Sachin, Score=170}
{TeamName=India, Name=Sehwag, Score=120}
{TeamName=Sri-Lanka, Name=Sangakara, Score=20}
{TeamName=Sri-Lanka, Name=Murali, Score=20}
{TeamName=Sri-Lanka, Name=Jayasurya, Score=70}
I need to generate the following XML structure
<node id="1" label="India" >
<node id="1.1" label="Sachin" Score="170" />
<node id="1.2" label="Sehwag" Score="120" />
</node>
<node id="2" label="Sri-Lanka">
<node id="2.1" label="Sangakara" Score="20" />
<node id="2.2" label="Murali" Score="20" />
<node id="2.3" label="Jayasurya" Score="70" />
</node>
How can I do this?