setWriteOuter(false);
}
@Override
public Object readObject(MessageReader mreader, Context context) throws DatabindingException {
StaxBuilder builder = new StaxBuilder();
try {
XMLStreamReader reader = ((ElementReader)mreader).getXMLStreamReader();
if (reader instanceof JDOMStreamReader) {
return ((JDOMStreamReader)reader).getCurrentElement();
}
return builder.build(reader).getRootElement();
} catch (XMLStreamException e) {
throw new DatabindingException("Could not parse xml.", e);
}
}