Not sure on what's the issue in forming an XML. All you need is to form a custom XML of yours making sure that you have all the matching open-close tags.
In case you are looking at creating XML file from client side on server side then you can have a look at this option:
XML Javascript[
^]
It is done using an ActiveXObject.
Or else, just form the XML using a your own defined structure and use it. Try!