title: undefined method error in ruby NoMethodError
body: <p>The following code returns an error and I dont know why:</p>
  
  <pre><code>require "rexml/document"
  include REXML
  
  file = File.new("test.xml")
  doc = REXML::Document.new file
  
   class Registration
       attr_accessor :number, :jurisdiction, :physicallyPresentInRegistrationCountry
   end 
  
   def constructRegistration(item, typeOfMerchant)
      reg = Registration.new
      element = item.elements[typeOfMerchant + "PhysicallyPresentInRegistrationCountry"]
      if element != nil then
          reg,physicallyPresentInRegistrationCountry = element.text
      else
          reg.physicallyPresentInRegistrationCountry = nil
      end 
      return reg
    end
  
    XPath.each(doc, "//transactionAuditRecordList/item") { |item|
       reg = constructRegistration(item, "seller")
       puts reg.physicallyPresentInRegistrationCountry    
    }  
  </code></pre>
  
  <p>rexml.rb:26: undefined method `physicallyPresentInRegistrationCountry' for "false":String (NoMethodError)</p>
  
  <pre><code>    from /usr/lib/ruby/1.8/rexml/xpath.rb:53:in `each'
  
      from /usr/lib/ruby/1.8/rexml/xpath.rb:53:in `each'
  
      from rexml.rb:24
  </code></pre>