def _find_element_text(element, match, default=None):
child = element.find(match)<EOL>try:<EOL><INDENT>return child.text<EOL><DEDENT>except AttributeError:<EOL><INDENT>if default is not None:<EOL><INDENT>return default<EOL><DEDENT>else:<EOL><INDENT>raise MissingElementError(element, match)<EOL><DEDENT><DEDENT>
Find a matching subelement and return its text.

    If default is given, return it if a matching subelement is not
    found.  Otherwise, ValueError is raised.