title: Parsing html-like document with xmlpullparser?
body: <p>So I've got to parse ugly files that contain nested tags like</p>
  
  <pre><code>&lt;p&gt;blah&lt;strong&gt;lah&lt;/strong&gt;blah&lt;/p&gt;
  </code></pre>
  
  <p>The nested tags are defined and I don't care about them. But they make XmlPullParser fail:</p>
  
  <pre><code>XmlPullParser parser = XmlPullParserFactory.newInstance().newPullParser();
  parser.setInput(some_reader);
  while (parser.next() != XmlPullParser.END_DOCUMENT) {
      if (XmlPullParser.START_TAG == event) {
          String tag = parser.getName();
          if (tag != null) {
              tag = tag.toLowerCase();
          } else {
              continue;
          }
         if ("p".equals(tag)) {
             String text = parser.nextText();
             // and here we go
             // org.xmlpull.v1.XmlPullParserException: expected: /p read: strong
          }
      }
  }
  </code></pre>
  
  <p>Question: any chance I could get away w/o preprocessing the file stripping all the unnecessary tags or using a third-party library?</p>
  
  <p>EDIT:
  Updated the snippet to actually make sense.</p>