xml parsing with awk

hi all..
need your help again..

i have xml file and i want to parsing some data from the xml file..

<ex-name="keroco">
<................>
<................>
<................>
              <br-name="cincai">
              <ship="123456">
              <...................>
              <....................>
              <br-name="cincai2">
              <ship="7890">
                   .
                   .
                   .
<ex-name="keroco2">
<................>
<................>
<................>
              <br-name="testing1">
              <ship="1212">
              <...................>
              <....................>
              <br-name="testing2">
              <ship="1313">
                   .
                   .
                   .  

output :

keroco;cincai;123456
keroco;cincai2:7890
keroco2;testing1;1212
keroco2;testing2;1313

really need your help..
thanks alot

Try this...

awk -F '"' '{if($0 ~/<ex-name=/){s=$2}else{if($0 ~ /<br-name=/) { p=$2}else{if($0 ~ /<ship=/ ){p=p";"$2;print s";"p}}}}' file

Another one:

awk -F\" '/<ship=/{print p1,p2,$2}
/<br-name=/{p2=$2}
/<ex-name=/{p1=$2}' OFS=\; file

If you like to make generic tools to convert xml ex. to csv, then maybe you can find some helps from my Xml2Csv docs.
Main idea is to convert all to element format and then create csv.
Using ex. xsltproc process will be something like:

# remove some elements and attributes  
xsltproc remove.xsl ex1.xml > ex1.b.xml 
# change attributes => elements  
xsltproc xml2elements.xsl ex1.b.xml > ex1.e.xml 
# to csv  
xsltproc xml2csv.xsl ex1.e.xml > ex1.csv

If somebody has done same using awk, I like to use it also ...