Added XML resources and fixed code for new Ruby/Rails version