Array#to_xml always ignores the supplied block if the Array is empty. There is a ticket with a patch to always yield to the block: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2241 I added a patch that won''t break the current API. It allows passing in an ":always_yield => true" option to yield to the block even when empty. Tests included. Either patch would make me happy.