public void flush() throws Exception {
  buffer.write(result);
  buffer.clear();
  result.flush();
}

public void flush ( ) throws Exception { buffer . write ( result ) ; buffer . clear ( ) ; result . flush ( ) ; }
this is used to flush the writer when the xml if it has been buffered . the flush method is used by the node writer after an end element has been written . flushing ensures that buffering does not affect the result of the node writer .
