Hi!
Try parsing the string to a DOM Document, then traverse it using DOM Traversal APIs removing empty elements as you go and then serialize the result back to a string:
// get DOM Document
Document dom = XmlUtils.parse( content );
// traverse as documented at http://www.cafeconleche.org/books/xmljava/chapters/ch12.html
...
// serialize back to string
StringWriter writer = new StringWriter();
XmlUtils.serialize( dom, writer );
// save in context
context.setProperty( BaseHttpRequestTransport.REQUEST_CONTENT, writer.toString() );
Hope this helps!
regards,
/Ole
eviware.com