Hi,
Newbie beginner question
I have the following .js file whereby the user enters book title search and this code returns the book title if it exists from the XML file. So far so good but I'm not acheiving much! If the book exists, I want to return the other elements too ie. the data from the <book_review> element and the data from the <author> element. How can I adapt the code to return these elements along with the <title> element.
Thank you for your time and expertise.

Code:
window.onload = loadIndex;
function loadIndex() { // load indexfile
	if (document.implementation && document.implementation.createDocument) {
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.load("index.xml");
	}
	else if (window.ActiveXObject) {
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async = "false";
		xmlDoc.load("index.xml");
	}
}
function searchIndex() { 
	if (!xmlDoc) {
		loadIndex();
	}
	var searchterm = document.getElementById("searchme").value;
	var allitems = xmlDoc.getElementsByTagName("title");
        results = new Array;
	if (searchterm.length < 2) {
		alert("Enter at least two characters");
	} else {
		for (var i=0;i<allitems.length;i++) {
			var name = allitems[i].lastChild.nodeValue;
			var exp = new RegExp(searchterm,"i");
			if ( name.match(exp) != null) {
				results.push(allitems[i]);
			}
		}
	showResults(results, searchterm);
	}
}
function showResults(results, searchterm) {
	if (results.length > 0) {
		var resultshere = document.getElementById("resultshere");
		var header = document.createElement("h5");
		var list = document.createElement("ul");
		var searchedfor = document.createTextNode("You've searched for "+searchterm);
		resultshere.appendChild(header);
		header.appendChild(searchedfor);
		resultshere.appendChild(list);
		for (var i=0;i<results.length;i++) {
			var listitem = document.createElement("li");
			var item = document.createTextNode(results[i].lastChild.nodeValue);
			list.appendChild(listitem);
			listitem.appendChild(item);
		}
	} else {
		var resultshere = document.getElementById("resultshere");
		var para = document.createElement("p");
		var notfound = document.createTextNode("Sorry, I couldn't find anything like "+searchterm +"!");
		resultshere.appendChild(para);
		para.appendChild(notfound);
	}
}