Android: write a file with the content of a XmlPullParser
<p>I have following file from a parser:</p>

<pre><code>Resources res = getResources();
XmlResourceParser parser = res.getXml(R.xml.textvalues);
</code></pre>

<p>and I want to copy its content to my private storage to be able to work with it, I would like to do it like this:</p>

<pre><code>String FILENAME = "hello_file";
String string = parser.ToString();

FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
</code></pre>

<p>But parser.ToString doesn't return the XML content. Do I really need to iterate over the whole parser and use a StringBuilder to get my XML?</p>

<p>Thanks!</p>
