public void save(OutputStream stream) throws IOException {
try {
AttributesImpl attrs = new AttributesImpl();
StreamResult result = new StreamResult(stream);
SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory
.newInstance();
TransformerHandler handler = factory.newTransformerHandler();
Transformer serializer = handler.getTransformer();
serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
serializer.setOutputProperty(OutputKeys.INDENT, "yes");
serializer.setOutputProperty(OutputKeys.METHOD, "xml");
serializer.setOutputProperty(