The transmitted request just needs to specify the mime type correctly and setting the text length correctly is a good idea.
See
this Wikipedia page.
For example you want the request headers set like:
Content-Length: (your text size)
Content-Type: application/xml
See java.net.URLConnection.setRequestProperty
Bill