added missing cast to XML mistakenly removed in previous commit