Improving search through XML file
A few general things from a quick scan:


declare all your variables at the top in one var statement rather than using it throughout the script
use somearray.push(x) rather than somearray[somearray.length]=x, as its shorter and means you don't have to look up the .length property every time in your loop
in general, avoid with; there are many reasons why e.g. http://www.yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/
string concatenation is slow; instead of many += operators, create an array, use .push() as above to add strings to the array, then use .join('') to merge them together.


And yes, XPath would be a better approach to extract data from XML.