xml isn't defined at all, you'd need to initialise it to nil or use `defined?`