builder.classAlias("TomsClass");
ObjectToXStream objectToXStream = new ObjectToXStream(builder.build());
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);
assertEquals("Tom", bean.getName());
assertEquals("1234", bean.getPhone());
}