Review and enhance xml parsing