code: public void store(Document doc, Resource res) throws IOException {
  	try {
  	    XMLCaster.writeTo(doc, res);
  	}
  	catch (PageException e) {
  	    throw ExceptionUtil.toIOException(e);
  	}
  
  	/*
  	 * 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); }
  	 */
      }
docs: store loaded data to xml file
  
  @param doc
  @param res
  @throws IOException