try {
streamWriter = xof.createXMLStreamWriter(writer);
} catch (XMLStreamException e) {
e.printStackTrace();
}
XMLStreamWriter indentingStreamWriter = new IndentingXMLStreamWriter(new CDataXMLStreamWriter(streamWriter));
try {
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
marshaller.marshal(rules, indentingStreamWriter);
} catch (JAXBException e) {