updated xpath evaluate functions and typecheking for leafnodes added