Raise exception when an invalid xml is passed