public Object readObject(MessageReader mreader, Context context) throws DatabindingException {
try {
XMLStreamReader reader = ((ElementReader)mreader).getXMLStreamReader();
// we need to eat the surrounding element.
reader.nextTag();
Object tree = StaxUtils.read(builder, new FragmentStreamReader(reader), true);
reader.nextTag(); // eat the end tag.
return tree;
} catch (XMLStreamException e) {
throw new DatabindingException("Could not parse xml.", e);
}