Here you can find the source of XMLFileToString(String xmlname, Context context)
public static String XMLFileToString(String xmlname, Context context)
//package com.java2s; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import android.content.Context; public class Main { public static String XMLFileToString(String xmlname, Context context) { InputStream XML_Stream = context.getClassLoader() .getResourceAsStream(xmlname); BufferedReader in = new BufferedReader(new InputStreamReader( XML_Stream));//w w w .j a v a 2 s . c o m StringBuffer buffer = new StringBuffer(); String line = ""; try { while ((line = in.readLine()) != null) { buffer.append(line); } } catch (IOException e1) { e1.printStackTrace(); } return buffer.toString(); } }