bring node-expat API  , but in pure javascript