xmldoc.find("/*").each do |e| begin html_string << e.to_s rescue # do nothing end end