sloppy xml parser written in javascript