Message oMsg = MessageFactory.getInstance().getMessage();
oMsg.getBody().add(new TestBean("Tom", "1234"));
objectToXStream.process(oMsg);
String xml = (String)oMsg.getBody().get();
XStream xstream = new XStream(new DomDriver());
xstream.alias("TomsClass", TestBean.class);
TestBean bean = new TestBean();
assertTrue("Expected start with [<TomsClass>]. Got [" + xml + "]", xml.startsWith("<TomsClass>"));
xstream.fromXML(xml, bean);