Find out values between xml tag

 Find out values between xml tag

.......
ABC><name></ABC><xyz>test</xyz>..here some other tag... <ABC><NUMBER></ABC><xyz>12345</xyz>....
.......

I want to take between bewtween ABC><NUMBER></ABC><xyz> to </xyz> that is 12345
awk -F'ABC><NUMBER></ABC><xyz>|</xyz>' '{print $3}' infile
12345

If you give a real data sample, its much more easy to give a correct answer.

Perl

perl -nle 'print $1 if (/<ABC><NUMBER><\/ABC><xyz>(.+?)<\/xyz>/);' infile

in sed

 
sed  's!.*<ABC><NUMBER></ABC><xyz>\(.*\)</xyz>.*!\1!g' filename