/**
* JAXB RI marshals the given bean to a JSON representation as expected even though it does not handle contents of
* {@code ComplexXmlEventBean#cdata} field as a CData section but as a pure XML element with text data in it.
*/
public void _testXmlCdataAnnotation(final JSONConfiguration configuration) throws Exception {
final JAXBContext jaxbContext = new JSONJAXBContext(ComplexXmlEventBean.class);
// Marshal
final Marshaller marshaller = jaxbContext.createMarshaller();
final StringWriter writer = new StringWriter();
final Object testInstance = ComplexXmlEventBean.createTestInstance();
marshaller.marshal(testInstance,
Stax2JsonFactory.createWriter(writer, configuration, ComplexXmlEventBean.class, jaxbContext));
System.out.println("Marshalled XML:");
marshaller.marshal(testInstance, System.out);
System.out.println("\nMarshalled JSON:");
System.out.println(writer.toString());
// Unmarshal
final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
final JAXBElement<ComplexXmlEventBean> unmarshal = unmarshaller.unmarshal(
Stax2JsonFactory.createReader(new StringReader(writer.toString()), configuration, null,
ComplexXmlEventBean.class, jaxbContext, false),
ComplexXmlEventBean.class);