I have an XML of following format. I want to extract the \'title\' and \'submenu\' tags and create a menu bar structure out of it as in the image below.
<
You have to use jquery's parseXML function,
var xml = "<rss version='2.0'><channel><title>RSS Title</title></channel></rss>", xmlDoc = $.parseXML( xml ), $xml = $( xmlDoc ), $title = $xml.find( "title" ); alert($title.text());
Refer https://api.jquery.com/jQuery.parseXML/