Here you can find the source of loadXML(String fileName)
public static String loadXML(String fileName) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class Main { public static String loadXML(String fileName) throws IOException { File mineContents = new File(fileName); BufferedReader reader = new BufferedReader(new FileReader(mineContents)); StringBuffer mineXML = new StringBuffer(); String str;/*from ww w .j ava 2 s . co m*/ while ((str = reader.readLine()) != null) { mineXML.append(str); } reader.close(); return mineXML.toString(); } }