data = response.read() doc = libxml2dom.parseString(data, html=1) title_elements = doc.getElementsByTagName("title") guid_elements = doc.getElementsByTagName("guid") for guid in guid_elements: for guid_node in guid.childNodes: link[guid_node.nodeIndex] = guid_node.nodeValue for title in title_elements: for title_node in title.childNodes: print "title: %s guid: %s" % (title_node.nodeValue,link[title_node.nodeIndex])