Added better xml parsing