You can build a DOM tree on the fly and add request parameters to the tree. When you're done, you can then serialize the tree to a document. Checkout XSP taglib for appropriate tags to do this. It would be a lot easier if you did it using
Servlets, then you can use standard DOM code without any tag hassles. JSPs become Servlets anyway....