Hi Imran,
I did not use
XStream, but as far as i see you can create an object, set its fields based on user input and serialize it to XML with XStream. I guess it will have less numbers of lines and easier to maintain compared to manual serialization.
As far as i see, it is also possible to do this with JAXB. Check following tech tip:
Object Serialization with the JAXB Libraries and Revisiting Timers with Enterprise Beans Tech Tips