require 'nokogiri'
doc = Nokogiri::XML.parse <<-EOT
<xml>
<advcampaign_categories>
<category id="85">Sport</category>
<category id="79">Mobile</category>
<category id="62">Flowers</category>
</advcampaign_categories>
</xml>
EOT
# if you are >= 2.1
doc.css('category').map { |node| [node.text, node['id'].to_i] }.to_h
# => {"Sport"=>85, "Mobile"=>79, "Flowers"=>62}
# if you are below version < 2.1
Hash[doc.css('category').map { |node| [node.text, node['id'].to_i] }]
# => {"Sport"=>85, "Mobile"=>79, "Flowers"=>62}