Using XML nodeValue as search criteria?

I am in the process of making a search function for my XML file, is it possible to use a value of a node as a search criteria? I know you can use attributes but that would not be an efficient way for me to do this. The main functionI am trying to use at the moment looks something like this

function Search(menu_xml){
    
    var items = menu_xml.firstChild.firstChild.childNodes; 
    for (var i=0; i<items.length; i++) {
        
        if (items*.firstChild.nodeValue == _root.search) { 
            
            var name = items*.firstChild; 
            var info = items*.childNodes[1]; 
            
            _root.name_txt.text = name.firstChild.nodeValue;
            _root.info_txt.text = info.firstChild.nodeValue;
        }
    }
}

and my XML file is structured like

<menu>
<submenu>
<item>
<name>xyz</name>
<info>abc</info>
</item>
</submenu>
</menu>

Maybe I am going at this in the wrong way bu any advice would be appreciated