Thanks for your answer, if I knew how to do it definitely I wouldn't ask this question, so would you please tell me how can I do this via Java code? please note that I want to
have the form's data in XML.
There is nothing magic about XML, just a syntax requirement, so it doesn't matter how the elements get written.
Since you say you control the server side code, there appears to be no reason to do any creation of XML on the client side at all. Is there some reason you are not treating this as a normal form parameter processing problem?
If you absolutely have to send XML from the client, for some reason you have not explained, why not build the XML formatted request to send to the server by ordinary String writing?