FileOutputStream fos = new FileOutputStream("table.xml", false); PrintWriter pw = null; pw = new PrintWriter(fos); char[] chars = lines.toCharArray(); for (int i=0; i