reading nested tag xml file in hive

i have the following xml file 
<rec><name><fname>Ravi</fname><lname>kumar</lname></name>
<age>25</age><contact>
<email><personal>ravi@gmail.com</personal>
<official>ravi@infy.com</official></email>
<phone><mobile>12345</mobile>
<office>12346</office>
<residence>12347</residence></phone></contact></rec>

How to read the nested tags!! i am new to hive 

select xpath_string(line,'rec/name/fname'),xpath_string(line,'rec/name/lname'),xpath_int(line,'rec/age'),

xpath_string(line,'rec/contact/phone/residence') from <table_name>;

Hope this will help..