This is the sample xml document :
Everyday Italian
If you want to call grep from inside python, see the discussion here, especially this post.
If you want to search through all the files in a directory you could try something like this using the glob module:
import glob
import os
import re
p = re.compile('>.*<')
os.chdir("./")
for files in glob.glob("*.xml"):
file = open(files, "r")
line = file.read()
list = map(lambda x:x.lstrip('>').rstrip('<'), p.findall(line))
print list
print
This searches iterates through all the files in the directory, opens each file and exteacts text matching the regexp.
Output:
['Everyday Italian', 'Giada De Laurentiis', '2005', '300.00', 'Harry Potter', 'J
K. Rowling ', '2005', '625.00']
EDIT: Updated code to extract only the text elements from the xml.