title: Stax parse doesn't return proper response
body: <p>Hi ,</p>
  
  <p>I am facing very strange issue while parsing SOAP Response with Jaxb. I am not able to get complete list of  tags while parsing .Stax parser is able to parse only one tag ,its not giving any error or exception.However if I try to format the xml response(which is stored in string) Everything works perfectly fine. Here is what I am doing to parse it :-</p>
  
  <pre><code>  public void parseResponse(){
       String response="&lt;SOAP:Body&gt;&lt;response&gt;&lt;result&gt;&lt;myTag&gt;&lt;/myTag&gt;&lt;myTag&gt;&lt;/myTag&gt;/result&lt;/response&lt;/SOAP:Body&gt;";
  
       getUnmarshalledObject(response,myTag,MyTag.class,"com.mylearning.parseXml");
       } 
  
  
  
  
  
       public  &lt;T&gt; List&lt;T&gt; getUnmarshalledObject( String response ,String TAG_TO_SEARCH ,Class&lt;T&gt; clazz , String basePkg) 
                                      throws XMLStreamException, JAXBException{
                              Reader reader = new StringReader(response);
                              XMLInputFactory xif = XMLInputFactory.newInstance();
                              XMLStreamReader xsr = xif.createXMLStreamReader(reader);
  
                              List&lt;T&gt; listOfUnmarshalledObjects = new ArrayList&lt;T&gt;();
                              while (xsr.hasNext()) {
                                  if (xsr.getEventType() == XMLStreamReader.START_ELEMENT &amp;&amp; TAG_TO_SEARCH.equals(xsr.getLocalName())) {
                                          T unmarshalledObj = unmarshalXml( clazz ,xsr, basePkg);
                                          listOfUnmarshalledObjects .add(unmarshalledObj);
                                      }
                                      xsr.next();
                                  }
                              return listOfUnmarshalledObjects;
                          }
  </code></pre>
  
  <p>Here are different use cases of the problem:-   </p>
  
  <pre><code>            Case 1:- Input String response is unformatted.
              Result :- listOfUnmarshalledObjects is 1.
  
              Case 2:- Format response with response.replaceAll("&gt;&lt;","&gt;\n&lt;"); 
              Result:- listOfUnmarshalledObjects is 2.
  
              Case 3 : Input String unformatted , just give space b/w &lt;/myTag&gt;&lt;myTag&gt;
              Result:  listOfUnmarshalledObjects is 2.
  
              I tried my best to explain the question, please help me.                    
              &gt; Blockquote
  </code></pre>