Download XML to string
<p>I tried to download XML by using the code below:</p>

<pre><code> @Override
 protected String doInBackground(String... params) {
      try {    
           URL url = new URL("http://xx.xx.xx.xx/1.xml");
           URLConnection ucon = url.openConnection();
           ucon.setRequestProperty("Accept", "application/xml");

           InputStream is = ucon.getInputStream();
           BufferedInputStream bis = new BufferedInputStream(is);

           ByteArrayBuffer baf = new ByteArrayBuffer(50);
           int current = 0;
           while ((current = bis.read()) != -1) {
                baf.append((byte) current);
           }
           String str = new String(baf.toByteArray(), "UTF8");

           return str;
      } catch (MalformedURLException e) {
           Log.e(DEBUG_TAG, "6",e);
      } catch (IOException e) {
           Log.e(DEBUG_TAG, "7",e);
      }
      return "error";
 }
</code></pre>

<p>and I am getting the error:</p>

<blockquote>
  <p>12-12 08:12:15.434: ERROR/myLogs(10977): java.io.FileNotFoundException: <a href="http://xx.xx.xx.xx/1.xml" rel="nofollow">http://xx.xx.xx.xx/1.xml</a></p>
</blockquote>

<p>If I open this url in browser is see:</p>

<pre><code>This XML file does not appear to have any style information associated with it. The document tree is shown below.
&lt;Home&gt;
&lt;Child sex="male" age="5" name="Vasya"/&gt;
&lt;pets&gt;
&lt;Dog age="3" name="Druzshok"/&gt;
&lt;/pets&gt;
&lt;/Home&gt;
</code></pre>
