How to grab data from xml block?

I tried searching the forums, but couldn't find anything relevant to my question.

I have an xml file like the following:

	<topLevel numberBlock="BLOCK1">
		<item="content1" title="Content 1">
			<RefPath="path/to/file1.txt />
		</item>
		<item"content2" title="Content 2" >
			<RefPath="path/to/file2.txt" />
		</item>
	</topLevel>

I want to grab the data only found in "BLOCK1". Specifically, I want the the "item" and "RefPath".

So the output would look like this:

		<item="content1" title="Content 1">
			<RefPath="path/to/file1.txt />
		<item="content2" title="Content 2" >
			<RefPath="path/to/file2.txt" />

I tried the following code, but it gives me additional RefPaths after BLOCK1 (there are numerous blocks:

grep -E 'item="content | RefPath' inputfile.xml
$ cat a.txt
<topLevel numberBlock="BLOCK1">
        <item="content1" title="Content 1">
            <RefPath="path/to/file1.txt"/>
        </item>
        <item="content2" title="Content 2" >
            <RefPath="path/to/file2.txt" />
        </item>
    </topLevel>
$ awk -F\" '/BLOCK1/{a=1} /<\/toplevel>/{a=0} a && /item/ {item=$2} a && item  && /RefPath/ {path=$2} a && item && path {print item,path;item=path=0}' a.txt
content1 path/to/file1.txt
content2 path/to/file2.txt

thanks itkamaraj. I found a different variation to solve my problems. I used to isolate block one from the other blocks.

sed -n '/topLevel numberBlock="BLOCK1"*/,/<\/topLevel>/p' inputfile.xml

Or maybe something like this?

awk '/<topLevel/ && /BLOCK1/{f=1}
f && /<\/topLevel/{f=0}
f && /<item/{print; getline; print}
' file

way better than mine!