package dendrarium.trees.svg;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jdom.*;
import org.jdom.output.XMLOutputter;
import org.jdom.output.Format;
/**
 *
 * @author tomek
 */
public class TreeOutputter {

    public static void writePrettyFile(String fname, Document doc) {
        try {
            FileOutputStream out;
            out = new FileOutputStream(fname);
            XMLOutputter xmlOut = new XMLOutputter(Format.getPrettyFormat());
            xmlOut.output(doc, out);
            out.flush();
            out.close();
        } catch (IOException ex) {
            Logger.getLogger(TreeDrawer.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//end writePrettyFile
}