Configured with three variables passed to the constructor:
indentString added at each level
  of output; e.g. two spaces or a tablineSeparatorString to break lines with,
  no line breaking is performed if this is null or the empty string
  encodingOptions can be set with these twelve methods:
  public void setLineSeparator(String separator) {}
  public void setNewlines(boolean newlines) {}
  public void setEncoding(String encoding) {}
  public void setOmitEncoding(boolean omitEncoding) {}
  public void setSuppressDeclaration(boolean suppressDeclaration) {}
  public void setExpandEmptyElements(boolean expandEmptyElements) {}
  public void setTrimText(boolean trimText) {}
  public void setPadText(boolean padText) {}
  public void setIndent(String indent) {}
  public void setIndent(boolean doIndent) {}
  public void setIndentLevel(int indentLevel) {} 
  public void setIndentSize(int indentSize) {}
The output() method writes a Document onto a given 
OutputStream: 
  public void output(Document doc, OutputStream out) throws IOException {}
  public void output(Document doc, Writer writer) throws IOException {}
There are also output() methods for other JDOM classes: 
  public void output(Element element, Writer out) throws IOException {}
  public void output(Element element, OutputStream out) {}
  public void outputElementContent(Element element, Writer out) throws IOException {}
  public void output(CDATA cdata, Writer out) throws IOException {}
  public void output(CDATA cdata, OutputStream out) throws IOException {}
  public void output(Comment comment, Writer out) throws IOException {}
  public void output(Comment comment, OutputStream out) throws IOException {}
  public void output(String string, Writer out) throws IOException {}
  public void output(String string, OutputStream out) throws IOException {}
  public void output(Entity entity, Writer out) throws IOException {}
  public void output(Entity entity, OutputStream out) throws IOException {}
  public void output(ProcessingInstruction processingInstruction, Writer out)
    throws IOException {}
  public void output(ProcessingInstruction processingInstruction, OutputStream out)
   throws IOException {}
  public String outputString(Document doc) throws IOException {}
  public String outputString(Element element) throws IOException {}