import urllib.request, urllib.error, urllib.parse
data = urllib.request.urlopen('http://www.example.com/file.xml').read()
print(data.count('foobar'))
In Python - Parsing a response xml and finding a specific text vaule