improved xml parser