Use ElementTree's XPath to find the <tag> element
Avoid potential issues with mixing strings and ints
Replace httplib by urllib2