xml parsing improved