JJ: fixed handling detection of tags, added dtd's for entity parsing
JJ: new approach for findTag using HTMLParser of lxml
JJ: chnaged findtag to solve problems with mismatched tags