Grep XML tags

I want to search the below XML pattern in the XML files, but the XML files would be in a .GZ files,

<PRODID>LCTO84876</PRODID>
<PARTNUMBER>8872AC1</PARTNUMBER>
<WWPRODID>MODEL84876</WWPRODID>
<COUNTRY>US</COUNTRY>
<LANGUAGE>1</LANGUAGE>

What's the command/script to search it ? :confused:

here's a Python alternative:

#!/usr/bin/python
import re
all = open("yourxml.xml").read()
pat = re.compile(r"<PRODID>.*</LANGUAGE>", re.MULTILINE|re.DOTALL)
for found in pat.findall(all):
	print found

Output:

<PRODID>LCTO84876</PRODID>
<PARTNUMBER>8872AC1</PARTNUMBER>
<WWPRODID>MODEL84876</WWPRODID>
<COUNTRY>US</COUNTRY>
<LANGUAGE>1</LANGUAGE>

Using perl you can do :

perl -n -e 'printf if /<(PRODID|PARTNUMBER|WWPRODID|COUNTRY|LANGUAGE)>.*<\/\1>/' 

Jean-Pierre.