improved xml reading