title: Correct indentation (pretty print) of an SVG file with Apache Batik
body: <p>I need to understand how apache batik indents the SVG file produced by the library.
  I have the following code:</p>
  
  <pre><code>DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
  
          String svgNS = "http://www.w3.org/2000/svg";
          Document document = domImpl.createDocument(svgNS, "svg", null);
  
          SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(document);
  
          SVGGraphics2D svgGenerator = new SVGGraphics2D(ctx, false);
  
          for(Drawable savedDrawable : cVwDrawLocal.getSavedDrawables()){
              if(savedDrawable instanceof GeoDrawable){
                  savedDrawable.copyToGraphics(svgGenerator);
              }
          }
  
          boolean useCSS = true; // we want to use CSS style attributes
  
          String svgFile = svgFileName + ".svg";
  
          try {
              OutputStream outputStream = new FileOutputStream(svgFile);
              Writer outputStreamWriter = new OutputStreamWriter(outputStream, "UTF-8");
              svgGenerator.stream(outputStreamWriter, useCSS);
          } catch (Exception e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
          }
  </code></pre>
  
  <p>And the produced SVG file is:</p>
  
  <pre><code>&lt;g
    &gt;&lt;g style="fill:white; stroke-miterlimit:1; stroke-dasharray:1; stroke-dashoffset:1; stroke:white;"
      &gt;&lt;line y2="432" style="fill:none;" x1="873" x2="873" y1="432"
      /&gt;&lt;/g
      &gt;&lt;g style="fill:rgb(0,252,253); stroke-miterlimit:1; stroke-dasharray:0.1,5; stroke-width:2; stroke-dashoffset:1; stroke:rgb(0,252,253);"
      &gt;&lt;line y2="479" style="fill:none;" x1="901" x2="910" y1="490"
      /&gt;&lt;/g
      &gt;
  </code></pre>
  
  <p>But I need something like this:</p>
  
  <pre><code>&lt;g&gt;
      &lt;g style="fill:white; stroke-miterlimit:1; stroke-dasharray:1; stroke-dashoffset:1; stroke:white;"&gt;
          &lt;line y2="432" style="fill:none;" x1="873" x2="873" y1="432"/&gt;
      &lt;/g&gt;
      &lt;g style="fill:rgb(0,252,253); stroke-miterlimit:1; stroke-dasharray:0.1,5; stroke-width:2; stroke-dashoffset:1; stroke:rgb(0,252,253);"&gt;
          &lt;line y2="479" style="fill:none;" x1="901" x2="910" y1="490"/&gt;
      &lt;/g&gt;
  &lt;/g&gt;
  </code></pre>
  
  <p>How can I obtain this?
  Thank you in advance!</p>