Hello,
Where is exactly the problem lying? Please follow the DOM approach link and you will understand how to build such XML easily.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/bb/576637dca511d4990b00508b6b8b11/frameset.htm
In case you need and example please check demo program T_DOM_MANIPULATE.
Regards
Marcin Pciak