3ventic’s method is good. If you’re still having issues, this is how I’m doing the parsing in a library I’m working on.