considering the following function
private static void GetText(String nodeValue) throws IOException { if(!file3.exists()) { file3.createNewFile();
You could print through a PrintStream.
PrintStream ps = new PrintStream(fop); ps.println(nodeValue); ps.close();