def find_entry(element, parameter):
    """the DTIPrep QA XML uses <entry> tags and parameter attributes 
    to name the tags

    this function takes an XML element and a parameter name and 
    returns the child "entry" element with the matching parameter

    raises ValueError if a matching element is not found
    """
    for ce in element.childNodes:
        if ce.nodeType != ce.ELEMENT_NODE:
            continue
        if ce.nodeName != 'entry':
            continue
        if ce.getAttribute('parameter') == parameter:
            return ce
    raise ValueError('<element parameter="%s"> not found' % parameter)