// marshall the SObject
// first process annotations on the class, for things like alias, etc.
localXStream.processAnnotations(sObject.getClass());
ByteArrayOutputStream out = new ByteArrayOutputStream();
// make sure we write the XML with the right encoding
localXStream.toXML(sObject, new OutputStreamWriter(out, StringUtil.__UTF8_CHARSET));
request = new ByteArrayInputStream(out.toByteArray());
} else {
// if all else fails, get body as String
final String body = in.getBody(String.class);
if (null == body) {