I downloaded and looked at your code. You're on a good start (take it from someone who wrote a PERL script to integrate with Nagios & WebSphere a year or two ago.)
You might want to conside looking at the perfServlet help page: ..../wasPerfTool/servlet/perfservlet&
This will give you a list of v6 (perfServlet v6) commands you might find useful.
For example ../wasPerfTool/servlet/perfservlet?node=REPLACEMEWITHYOURNODENAME&module=threadPoolModule
This gives you immediate access to the specific node's thread pool module. It might be a much better solution than trying to traverse the XML that's returned. Again, just a suggestion of what to consider if you're thinking of expanding this to work in ND (with minimal changes.)
Unfortunately, I spent a week or two coding my solution before we found an issue in our system and decided to go a slightly different route. While I had a majority of the core code authored, I never made it adhere to the Nagios development standard, so it was never released.
Congrats on releasing your code!