I have a complex JDOM element like following (A), I need to change the structure like (B), for working on JAXB (Using with already existing classes, only thing I can do is changing the structure of xml), Can I able to do this using JDOM api?
As I am a beginer in java, it is very difficult for me, if anyone point-out a solution, it is very much helpful for me
Existing element (A)
<DETAILS>
<ROWSET name="OPTIONS">
<ROW num="1">
<Uniqueno>1000</Uniqueno>
<ROWSET name="SUSPENCE">
<ROW num="1">
<Uniqueno>1001</Uniqueno>
<ROWSET name="PERSONS">
<ROW num="1">
<Name>60821894</Name>
<Age>44</Age>
</ROW>
<ROW num="2">
<Name>60821894</Name>
<Age>44</Age>
</ROW>
</ROWSET>
<ROWSET name="PERSONS">
<ROW num="1">
<Name>60821894</Name>
<Age>55</Age>
</ROW>
<ROW num="2">
<Name>60821894</Name>
<Age>55</Age>
</ROW>
<ROW num="3">
<Name>60821894</Name>
<Age>55</Age>
</ROW>
</ROWSET>
</ROW>
</ROWSET>
</ROW>
</ROWSET>
</DETAILS>
Required element (B)
<DETAILS>
<OPTIONS>
<Uniqueno>1000</Uniqueno>
<SUSPENCE>
<Uniqueno>1001</Uniqueno>
<PERSONS>
<Name>60821894</Name>
<Age>44</Age>
<Name>60821894</Name>
<Age>44</Age>
</PERSONS>
<PERSONS>
<Name>60821894</Name>
<Age>55</Age>
<Name>60821894</Name>
<Age>55</Age>
<Name>60821894</Name>
<Age>55</Age>
</PERSONS>
</SUSPENCE>
</OPTIONS>
</DETAILS>