UIViewRoot root = faces.getViewRoot();
this.servletRequest.setAttribute("test", "test2.xml");
f.apply(faces, root);
FastWriter fw = new FastWriter();
ResponseWriter rw = faces.getResponseWriter();
rw = rw.cloneWithWriter(fw);
faces.setResponseWriter(rw);
root.encodeAll(faces);
System.out.println(fw);
ComponentSupport.removeTransient(root);
this.servletRequest.setAttribute("test", "test3.xml");
f.apply(faces, root);
fw = new FastWriter();
rw = faces.getResponseWriter();
rw = rw.cloneWithWriter(fw);
faces.setResponseWriter(rw);
root.encodeAll(faces);
System.out.println(fw);