title: how to separate 'xml' tag from a given String
body: <p>I am new comer to rest API and I try to read <code>xml</code> tags in a restful API using Apache http .In here I've got all the <code>xml</code> tags together , but actually I want to get it as tag based . Which like following </p>
  
  <pre><code>&lt;xml&gt;something&lt;/xml&gt;
  </code></pre>
  
  <p>This is my <code>ClientProtocol</code> class which is used to read restful API . </p>
  
  <pre><code>package web;
  
  import java.io.BufferedInputStream;
  import java.io.InputStream;
  import org.apache.http.HttpEntity;
  import org.apache.http.HttpResponse;
  import org.apache.http.client.HttpClient;
  import org.apache.http.client.methods.HttpGet;
  import org.apache.http.impl.client.DefaultHttpClient;
  
  /**
   *
   * @author user
   */
  public class ClientProtocal
  {
  
      public static void main(String[] args)
      {
  
          HttpClient httpClient = new DefaultHttpClient();
          try
          {
              HttpGet httpGetRequest = new HttpGet("https://xxxxredddd");
              HttpResponse httpResponse = httpClient.execute(httpGetRequest);
  
              System.out.println("----------------------------------------");
              System.out.println(httpResponse.getStatusLine());
              System.out.println("----------------------------------------");
  
              HttpEntity entity = httpResponse.getEntity();
  
              byte[] buffer = new byte[1024];
              if (entity != null)
              {
                  InputStream inputStream = entity.getContent();
                  try
                  {
                      int bytesRead = 0;
                      BufferedInputStream bis = new BufferedInputStream(inputStream);
                      while ((bytesRead = bis.read(buffer)) != -1)
                      {
                          String chunk = new String(buffer, 0, bytesRead);
                          System.out.println(chunk);
                      }
                  } catch (Exception e)
                  {
                      e.printStackTrace();
                  } finally
                  {
                      try
                      {
                          inputStream.close();
                      } catch (Exception ignore)
                      {
                          ignore.printStackTrace();
                      }
                  }
              }
          } catch (Exception e)
          {
              e.printStackTrace();
          } finally
          {
              httpClient.getConnectionManager().shutdown();
          }
  
      }
  }
  </code></pre>