Here you can find the source of getStreamResultForFile(String filename)
public static StreamResult getStreamResultForFile(String filename)
//package com.java2s; import java.io.File; import javax.xml.transform.stream.StreamResult; public class Main { public static StreamResult getStreamResultForFile(String filename) { if (filename == null || "".equals(filename)) throw new IllegalArgumentException("Filename for result can't be null or empty."); return new StreamResult(new File(filename)); }/*from w ww .ja va 2 s. c o m*/ }