You can try like this and then export it into .xml type.
'<?xml version="1.0" encoding="utf-8" ?>'
& '<FileVersion>' & QlikViewVersion() & '</FileVersion>'
& '<DisplayName>' & TextBetween( @1,'<','>', 2 ) & '</DisplayName>'
& '<Enabled>' & 'True' & '</Enabled>'
& '<Name>' & TextBetween( @1,'<','>', 2 ) & '</Name>'
& '<Member>' & TextBetween( @1,'<','>', 2 ) & '</Members>'
& '<Name>' & TextBetween( @1,'<','>', 1 ) & '</Name>' AS XMLDATA
// ,TextBetween( @1,'<','>', 1 ) AS Group_Name,
// TextBetween( @1,'<','>', 2 ) AS Display_Name
(txt, codepage is 1252, no labels, delimiter is ' ', msq);
You could export a tablebox or a table-chart to xml - maybe with a triggered macro like this:
set tb = ActiveDocument.Sheets("Main").CreateTableBox
If this don't work you will have to built these xml-structure manually by doing a (nested) loop through your source-table and store this result as output.xml (txt). But this will need some efforts to build a valid structure - but you could start with something like this:
Load * From source;
for i = 0 to noofrows('source') - 1
let vField1 = peek('Field1', $(i), 'source');
When after exporting the table the xml-structure don't fit exactly to your requirements you will need some manually adjustment-steps maybe with a load-loop-statement like above mentioned. But maybe you could as an alternatively also adjust the target from the xml.
If at all the structure is more complicated it could be useful to look to another tools to convert or build the xml-structures: https://www.google.de/?gws_rd=ssl#q=tools+create+xml