}
JAXBContext context = getJAXBContext(obj.getClass());
Marshaller marshaller = context.createMarshaller();
XMLOutputFactory factory = new BadgerFishXMLOutputFactory();
XMLStreamWriter xsw = factory.createXMLStreamWriter(os);
marshaller.marshal(obj, xsw);
xsw.close();
} catch (JAXBException e) {
e.printStackTrace();