# File lib/quickbooks/base.rb, line 172
      def instantiate(obj_or_attrs={},attrs={})
        if obj_or_attrs.is_a?(Quickbooks::Base)
          obj = obj_or_attrs
        else
          obj = allocate
          attrs = obj_or_attrs
        end
        attrs.each do |key,value|
          if obj.respond_to?(key.to_s.underscore+'=')
            obj.send(key.to_s.underscore+'=', value)
            obj.original_values[key.to_s.underscore] = obj.instance_variable_get('@' + key.to_s.underscore).dup
          end
        end if attrs
        obj # Will be either a nice object, or a Qbxml::Error object.
      end