XML parsing with a variable

I have the following XML

 
<Audit_Type>1</Audit_Type><Session_Id>34505863</Session_Id>
<StatementId>1</StatementId><EntryId>1</EntryId>
<Extended_Timestamp>2012-03-06T10:25:20.789459</Extended_Timestamp>
<DB_User>KASINIY</DB_User>
<OS_User>majohn1</OS_User><OS_Process>28636</OS_Process>
<Terminal>CAIRVNBIS01</Terminal><Instance_Number>0</Instance_Number>
<Action>100</Action><TransactionId>0000000000000000</TransactionId><Returncode>0</Returncode><Comment_Text>Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.10)(PORT=4600))</Comment_Text><Priv_Used>5</Priv_Used>

Can somebody give me a SED/AWK statement that I can use to get
a spefic value.

To be efficient I would like the assign the value of a tag into a variable
and than use the variable in the parsing staement.

Ie

var=OS_User
sed $var .......

In addition, I may have 1 or many of these records in my file.

I may want to get the first, last or all occurances of $var

Thanks in advance to all who answer

First occurrence:

perl -lns0e '/$tag>([^<]+)/;print $1' -- -tag=$var file

All occurrences:

perl -lns0e 'while (/$tag>([^<]+)/g){print $1}' -- -tag=$var file

Last occurrence:

perl -lns0e 'while (/$tag>([^<]+)/g){$x=$1};print $x' -- -tag=$var 

Bartus,

Thanks for your reply.. the code works great. Since I don't have perl
installed on all my machines, is there a similiar solution using sed or awk?

$ awk -F'>' -v VAR="OS_User" -v RS='<' '/[/]/ { next }; ($1 == VAR) { print $2 }' data
majohn1

$
awk -F'>' -v VAR="OS_User" -v RS='<' '($1 == VAR) { print $2 }' data > /tmp/$$
while read USERNAME
do
        echo "got user $USERNAME"
done </tmp/$$
rm -f /tmp/$$