title: How to get the whole text of StAX XMLEvent object?
body: <p>I am using StAX Iterator api to read an xml.</p>
  
  <p>XML: </p>
  
  <pre><code>&lt;FormData OID="QUAL"&gt;
      &lt;IGData IGRepeatKey="1" IGOID="SQUAL" TType="Insert"&gt;
          &lt;IData Value="0859" IOID="SID"&gt;&lt;/IData&gt;
          &lt;IData Value="DM" IOID="RDOMAIN"&gt;&lt;/IData&gt;
      &lt;/IGData&gt;
      &lt;IGData IGRepeatKey="1" IGOID="SQUAL" TType="Insert"&gt;
          &lt;IData Value="0860" IOID="SID"&gt;&lt;/IData&gt;
          &lt;IData Value="2013-01-03T02:00" IOID="QVAL"&gt;&lt;/IData&gt;
      &lt;/IGData&gt;
  &lt;/FormData&gt;
  </code></pre>
  
  <p>And Stax code:</p>
  
  <pre><code>while(xmlEventReader.hasNext()){
      xmlEvent = xmlEventReader.nextEvent();
      eventString = xmlEvent.toString();
      if(xmlEvent.isStartElement() &amp;&amp; eventString.contains("FormData") &amp;&amp; eventString.contains("QUAL")){
          //do something
      }
  </code></pre>
  
  <p>}</p>
  
  <p>It is working (eventString has whole text of xmlEvent) in my local environment. </p>
  
  <p>But when i  deploy this into server, eventString contains like "Stax Event #1". So if condition is returning false. </p>
  
  <p>I thought both are using different XMLEvent implementations. So i checked it through code, and jar is same in both environments: jre1.8.0_73/lib/rt.jar!/javax/xml/stream/events/XMLEvent.class</p>
  
  <p>How to get the whole text of XMLEvent object? Am i doing anything wrong here? Please suggest any other alternatives.</p>