{
// XMLOutputFactory ofactory = XMLOutputFactory.newInstance();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
// XMLStreamWriter writer = ofactory.createXMLStreamWriter(bos);
XMLStreamWriter writer = STAXUtils.createXMLStreamWriter(bos, null, null);
TypeMappingRegistry tmr = new DefaultTypeMappingRegistry(true);
TypeMapping tm = tmr.createTypeMapping(true);
registerSimpleBeanType(tm);
registerArrayType(tm);
SimpleBean bean = new SimpleBean();