Refactored xml parser to use stack abstraction. It is allocated once per thread (in a thread local).