You may want to be testing for a logentry that contains a child element named $searchfield, which contains the $searchtext. This (in XSLT 1.0) is:

logentry[*[name() = $searchfield][contains(., $searchtext)]]