rewrote xml parser pull-style; block refcounting