how to convert text file to xml
<p>I want to convert the <code>text file</code> into <code>xml file</code>.I have a large amount of string but i dont want to write in xml directly.</p>

<p>So that I have made a text file now i want to convert this </p>

<p>text file into xml format but when i am running this file getting no output. here is my </p>

<p>code:</p>

<pre><code>public void convert() throws Exception {

 String text[]=new String[10];

 FileOutputStream fout = new FileOutputStream("res/values/mysml.xml");

 OutputStreamWriter out = new OutputStreamWriter(fout);  

 InputStream in= getAssets().open("myText.txt");

 Scanner scn = new Scanner(is);

for(int i=0;i&lt;10;i++)

text[i]=bin.readLine();

out.write("&lt;?xml version=\"1.0\"?&gt;\r\n");  

out.write("&lt;resources&gt;\r\n");  

for (int i = 0; i &lt; 10; i++){

out.write("&lt;item&gt;"+text[i]+"&lt;/item&gt;");

}

out.write("&lt;/resources&gt;");

out.flush();

out.close();
</code></pre>

<p>}</p>
