What does the return inside the if statements do in the following code?
public void startElement(String namespaceURI, String localName,String qName,
The return here is probably used in order to "improve" the performance of the method, so that other comparisons are not executed, once the needed scenario is performed.
However, it's not good practice to have multiple return points in a method.
As stated in my comments I'd try a different approach to achieve the flow of the code in question.