@sriniYou can import xml directly using com.ibm.spss.hive.serde2.xml.XmlSerDe which is detailed here:
https://community.hortonworks.com/articles/972/hive-and-xml-pasring.html
Other option is to load entire record in a string and then access it using xpath UDF :
1. create table employee( employee_info string) ;
2. load data local inpath '/home/hduser/sample.xml' into table employee;
3. create view employee_xml_view as SELECT xpath_int(employee_info ,'code/root/root1/id'),xpath_string(employee_info ,'code/root/root1/joiningdate'),xpath_string(employee_info ,'code/root/root1/joiningdate').................. from employee;
4. Select * from employee_xml_view;