/** * <p>write.</p> * * @param tree a {@link net.anotheria.util.xml.XMLTree} object. * @param stream a {@link java.io.OutputStream} object. * @return a {@link java.io.OutputStreamWriter} object. * @throws java.io.IOException if any. */ public static OutputStreamWriter write(XMLTree tree, OutputStream stream) throws IOException{ OutputStreamWriter writer = new OutputStreamWriter(stream, tree.getEncoding()); tree.write(writer); writer.flush(); return writer; } }
root.addChildNode(mappings); tree.setRoot(root); tree.write(out); out.flush(); out.close();