from_xml (ActiveResource::Errors)

    # File lib/active_resource/validations.rb, line 203
        def from_xml(xml)
          clear
          humanized_attributes = @base.attributes.keys.inject({}) { |h, attr_name| h.update(attr_name.humanize => attr_name) }
          messages = Hash.from_xml(xml)['errors']['error'] rescue []
          messages.each do |message|
            attr_message = humanized_attributes.keys.detect do |attr_name|
              if message[0, attr_name.size + 1] == "#{attr_name} "
                add humanized_attributes[attr_name], message[(attr_name.size + 1)..-1]
              end
            end

            add_to_base message if attr_message.nil?
          end
        end