title: How to parse SOAP XML output into a list view in Android
body: <p>Can anyone tell me how to parse SOAP output into list form? Here is my code and I want that output in list form. </p>
  
  <pre><code>public class WebServices extends Activity 
  {
  
  
      private static final String NAMESPACE = "http://www.webserviceX.NET";
      private static final String URL = "http://www.webservicex.net/globalweather.asmx";  
      private static final String SOAP_ACTION = "http://www.webserviceX.NET/GetWeather";
      private static final String METHOD_NAME = "GetWeather";
  
  
      @Override
       public void onCreate(Bundle savedInstanceState) 
      {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.main);
          TextView textView = new TextView(this);
          setContentView(textView);
          SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME);
  
          request.addProperty("CountryName", "India");
          request.addProperty("CityName", "Hyderabad");
  
          SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
          envelope.bodyOut = request;
          envelope.dotNet = true;
          envelope.setOutputSoapObject(request);
  
  
          HttpTransportSE httpTransport = new HttpTransportSE(URL);
  
          httpTransport.debug = true;
  
          try
          {
              httpTransport.call(SOAP_ACTION, envelope);
  
              Object response = envelope.getResponse();
              textView.setText(response.toString());
              String str = removeNamespace(response.toString());
              Document document = DocumentHelper.parseText(str);
              Element ele= document.getRootElement();
              List&lt;Element&gt; childlist = ele.elements();
              List&lt;String&gt; textList = new ArrayList&lt;String&gt;();
              for(Element child : childlist){
              textList.add(child.getTextTrim());
          }
              System.out.print(textList);
          }
  
              catch(Exception e)
              {
                 e.printStackTrace();
              }
      }
  </code></pre>