# File lib/qbxml/response.rb, line 87
    def import_from_hash(hsh)
      raise ArgumentError, "Hash passed to Qbxml::Response.from_hash must contain only one top-level key" unless hsh.keys.length == 1
      name = hsh.keys.first
      # for development
      self.raw_response = hsh
      # * * * *
      hsh = hsh[name]

      self.status = hsh['statusCode'].to_i
      self.severity = hsh['statusSeverity']
      self.message = hsh['statusMessage']
      # if self.status == 0 # Status is good, proceed with eating the request.
      # <ListDeletedQueryRs requestID="5" statusCode="0" statusSeverity="Info" statusMessage="Status OK">
      #   <ListDeletedRet>
      #     <ListDelType>Customer</ListDelType>
      #     <ListID>80000030-1203622308</ListID>
      #     <TimeCreated>2008-02-21T14:31:48-05:00</TimeCreated>
      #     <TimeDeleted>2008-03-18T17:31:12-05:00</TimeDeleted>
      #     <FullName>Rachel Parker</FullName>
      #   </ListDeletedRet>
      # </ListDeletedQueryRs>
        if m = name.match(/^(List|Txn)Del(etedQuery)?Rs$/)
          # (List|Txn)DelRs, or (List|Txn)DeletedQueryRs - both return just a few attributes, like ListID / TxnID and TimeDeleted
          list_or_txn = m[1]
          long_name = m[1]+'Del'+m[2].to_s
          ret_key = long_name.gsub(/Query$/,'')+'Ret'
          self.ret_items = hsh[ret_key].is_a?(Array) ? hsh[ret_key] : [hsh[ret_key]].compact # Force to be an array - it's return items!
          self.response_type = self.ret_items.empty? ? m[1] : self.ret_items[0][list_or_txn+'DelType']
        elsif m = name.match(/^((?:[A-Za-z][a-z]+)+)(Query|Mod|Add)Rs$/)
          self.response_type = m[1]
          self.ret_items = hsh[self.response_type+'Ret']
        else
          raise "Could not read this response:\n#{self.raw_response.inspect}"
        end
      # else # Status is bad.
        
      # end
      # puts self.inspect
      self
    end