code: public static void writeTo(Node node, Resource file) throws PageException {
  	OutputStream os = null;
  	try {
  	    os = IOUtil.toBufferedOutputStream(file.getOutputStream());
  	    writeTo(node, new StreamResult(os), false, false, null, null, null);
  	}
  	catch (IOException ioe) {
  	    throw Caster.toPageException(ioe);
  	}
  	finally {
  	    IOUtil.closeEL(os);
  	}
      }
docs: write a xml Dom to a file
  
  @param node
  @param file
  @throws PageException