title: Xml data is converted into Json data in android
body: <p>I need to parse XML data from a web service. But, when I am getting the data from the web service the data comes in the format of JSON (In the browser I am seeing the data as XML). So, please guide me how to get xml data into my application.</p>
  
  <p>I am using the following.</p>
  
  <p><strong>In my main activity:</strong></p>
  
  <pre><code>static final String URL = "http://nclex.testshell.net/api/resources";
  XMLParser parser = new XMLParser();
  String xml = parser.getXmlFromUrl(URL); // getting XML
  Log.e("Response is...",xml);
  </code></pre>
  
  <p><strong>My xmlParser class</strong></p>
  
  <pre><code>public class XMLParser {
  
      // constructor
      public XMLParser() {
  
      }
  
      /**
       * Getting XML from URL making HTTP request
       * @param url string
       * */
      public String getXmlFromUrl(String url) {
          String xml = null;
  
          try {
              // defaultHttpClient
              DefaultHttpClient httpClient = new DefaultHttpClient();
              HttpGet httpGet = new HttpGet(url);
  
              HttpResponse httpResponse = httpClient.execute(httpGet);
              HttpEntity httpEntity = httpResponse.getEntity();
              xml = EntityUtils.toString(httpEntity);
  
          } catch (UnsupportedEncodingException e) {
              e.printStackTrace();
          } catch (ClientProtocolException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
          // return XML
          return xml;
      }
  }
  </code></pre>
  
  <p><strong>output response is</strong></p>
  
  <blockquote>
    <p>[{"ResourceId":1,"Title":"GRE revised General Test","Description":"The
    Verbal Reasoning section of the GRE  revised General
    Test","Link":"<a href="http://www.ets.org/gre/revised_general/about/content/verbal_reasoning" rel="nofollow">http://www.ets.org/gre/revised_general/about/content/verbal_reasoning</a>"},{"ResourceId":2,"Title":"GRE Power Pre","Description":"GRE Power
    Pre","Link":"<a href="http://www.number2.com/exams/gre/companion/index.cfm?s=0" rel="nofollow">http://www.number2.com/exams/gre/companion/index.cfm?s=0</a>"},{"ResourceId":3,"Title":"GRE Analytical Writing","Description":"GRE Analytical
    Writing","Link":"<a href="http://www.mygretutor.com/tests.aspx" rel="nofollow">http://www.mygretutor.com/tests.aspx</a>"},{"ResourceId":4,"Title":"GATE
    Architecture &amp; Planning","Description":"GATE Architecture &amp;
    Planning","Link":"<a href="http://www.onestopgate.com/gate-sample-papers/architecture-planning/" rel="nofollow">http://www.onestopgate.com/gate-sample-papers/architecture-planning/</a>"},{"ResourceId":5,"Title":"TarGATE","Description":"GATE
    to acheive your
    target","Link":"<a href="http://gateforum.com/Testseries-Venue.php" rel="nofollow">http://gateforum.com/Testseries-Venue.php</a>"},{"ResourceId":6,"Title":"TOEFL
    iBT","Description":"TOEFL iBT  Test Sample
    Questions","Link":"<a href="https://www.ets.org/toefl/ibt/prepare/sample_questions" rel="nofollow">https://www.ets.org/toefl/ibt/prepare/sample_questions</a>"}]</p>
  </blockquote>