I don't think your code needs a design pattern. But clean code will be very nice.
I agree with Louis F. in the comments: "As a first step, you can try to extract the code for your different cases of switching to separate methods and give them meaningful names . "
I think your code has too many comments. This is code smell . Example:
if("Header".equals(xmlStreamReader.getLocalName())){
How to remove this comment and explain it with code ?
if(isTagHeader(xmlStreamReader)) { enableToParse = true; }
Just some thoughts ... your code doesn't look awful. But I think that the main thing here is not in design.
If you are interested in going deeper, I highly recommend Robert C. Martin (Uncle Bob), The Clean Code.
source share