You need to POST the form (either normal submit or Ajax call) and in the controller (or servlet) get the XML data, parse it, transform to POJOs and persist them.
I don’t quite understand what do you mean. Can you invoke getStateXML, store the result in a hidden and do a post ? I don’t see the need of an input text.
Since HTML form entry handles all the data base save function if we use this way we don’t have to implement the saving logic and it would save lot of time in my point of view.