public synchronized void store(Document doc,Resource res) throws IOException {
  OutputFormat format=new OutputFormat(doc,null,true);
  format.setLineSeparator("\r\n");
  format.setLineWidth(72);
  OutputStream os=null;
  try {
    XMLSerializer serializer=new XMLSerializer(os=res.getOutputStream(),format);
    serializer.serialize(doc.getDocumentElement());
  }
  finally {
    IOUtil.closeEL(os);
  }
}

public synchronized void store ( Document doc , Resource res ) throws IOException { OutputFormat format = new OutputFormat ( doc , null , true ) ; format . setLineSeparator ( "\r\n" ) ; format . setLineWidth ( 72 ) ; OutputStream os = null ; try { XMLSerializer serializer = new XMLSerializer ( os = res . getOutputStream ( ) , format ) ; serializer . serialize ( doc . getDocumentElement ( ) ) ; } finally { IOUtil . closeEL ( os ) ; } }
store loaded data to xml file
