Hey you can use below function to Generate xml for controls. In the below code I have displayed xml in new window . You can modify the code to make use of that xml however you want. I haven't added values in the xml tags as in question you haven't mentioned about values in details.
function displayFormData() {
NewWindow = open("", "window2")
NewWindow.document.open("text/plain")
var i = 0;
var j = 0;
var x = "";
for (i = 0; i < document.forms.length; ++i) {
x = "<" + document.forms[i].id + ">";
for (j = 0; j < document.forms[i].elements.length; ++j) {
x = x + "<" + document.forms[i].elements[j].id + ">";
x = x + "</" + document.forms[i].elements[j].id + ">";
}
x = x + "</" + document.forms[i].id + ">";
NewWindow.document.write(x);
}
NewWindow.document.close()
return false
}
Tell me if you need any further help on this one !!
Hope this helps :-)