code: public void toFile(File file) throws IOException {
  		String[] sitemap = toStringArray();
  		try(BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
  			for (String string : sitemap) {
  				writer.write(string);
  			}
  		}
  	}
docs: Construct and save sitemap to output file
  
  @param file
  Output file
  @throws IOException
  when error