I have what I think should be a straightforward question; let me quickly explain:
In my JavaScript, food.xml is read in with:
food.xml
getMenuXml.ope
It's a good idea to use a Javascript library to get ready-made functions w.r.t Node List operations such as re-ordering, sorting, foreach etc. I would recommend YUI-3, please refer YUI-3 NodeList .