> that's OK, since they don't actually relate to a rule instance at all.
I totally agree, and it would even improve speed & memory footprint, although by a very small amount.

> I'd be inclined to declare parseRule as a top-level function, and the others as private functions within that.
This, on the contrary, would slow things down a bit, since a few function objects would have to be created each time a rule is parsed.

Another way to go would be to declare a `Parser` class and have all the xml parsing methods bound to it.
It would avoid having the module global `tmp` used to store parsing state. But this might be for a future pull request !