Reading files in directory

Hi Everyone , have a nice day
i need a help on this thing
algo is something like
in certain path like /root/user1
i have many files , i need a code which could open every file one by one and then
each file has contents like this

<moid>CcnCounters=CAPv3-Received-Total-Requests, Source = Proc_m0_s23</moid>
<r>1100</r>
<sf>FALSE</sf></mv><mv>
<moid>CcnCounters=CAPv3-Received-Total-Requests, Source = _SYSTEM</moid>
<r>2196</r>
<sf>FALSE</sf></mv><mv>
<moid>CcnCounters=CAPv3-Sent-Total-Requests, Source = Proc_m0_s23</moid>
<r>1239</r>
<sf>FALSE</sf></mv><mv>
<moid>CcnCounters=CAPv3-Sent-Total-Requests, Source = _SYSTEM</moid>
<r>2463</r>
<sf>FALSE</sf></mv><mv>
<moid>CcnCounters=CAPv3-Sent-Total-Requests, Source = Proc_m0_s21</moid>
<r>1224</r>

and it should extract information between <moid> and </moid> and between <r> and </r>
as you can have idea <moid> has a counter name and <r> has counter value
so it should extract this from every file and keep on appending it in an output file like this

counter name counter value
counter name counter value
.................. ..................

untill it gets done with all files in /root/user1

Thanks in Anticipation and Regards

I suggest you do this in PERL.

only for one file. i leave it to you to do multiple files.

awk '/moid/{ gsub("<moid>|</moid>","");moid[c++]=$0}
    /<r>/{ gsub("<r>|</r>","");r[d++]=$0}
END{
  for(i=0;i<=c;i++) {
	print moid " " r
  }
}' "file"

output:

./test.sh
CcnCounters=CAPv3-Received-Total-Requests, Source = Proc_m0_s23 1100
CcnCounters=CAPv3-Received-Total-Requests, Source = _SYSTEM 2196
CcnCounters=CAPv3-Sent-Total-Requests, Source = Proc_m0_s23 1239
CcnCounters=CAPv3-Sent-Total-Requests, Source = _SYSTEM 2463
CcnCounters=CAPv3-Sent-Total-Requests, Source = Proc_m0_s21 1224

Try this!!!!!!!!!!!!!!!

sed 's/\(<moid>\)\(.*\)\(<\/moid>\)/\2/g' input file | cut -d"<" -f1 >countersource.txt

sed 's/\(<r>\)\(.\)\(<\/r>\)/\2/g' input file |grep "[0-9]" |sed 's/\(<moid>\)\(.*\)\(<\/moid>\)\(.\)/\4/g' >countername.txt