try {
DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
Document document = domImpl.createDocument(null, "svg", null);
SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
/* tady se určuje velikost grafu */
graf.draw(svgGenerator, new Rectangle2D.Double(0, 0, 640, 400));
Writer out = new OutputStreamWriter(new FileOutputStream(new File(soubor)), "UTF-8");
/** tady musí být FALSE, jinak je to rozsypané! */
svgGenerator.stream(out, false);
out.close();
} catch (IOException e) {