def xml_subelement_text(xml_elem, subelement, convert=None, default=None, quiet=False):
    """
    Return the text of the specified subelement

    For the document below:

    .. code-block:: xml

        <xml_elem>
            <subelement>text</subelement>
        </xml_elem>

    ``"text"`` will be returned

    :param xml_elem: search the children nodes of this element
    :param subelement: name of the subelement whose text will be retrieved
    :param convert: if not None, a callable used to perform the conversion of the text to a certain object type
    :param default: default value if subelement is not found
    :param quiet: if True, don't raise exceptions from conversions, instead use the default value
    :return: The text associated with the sub-element or ``None`` in case of error
    """
    if xml_elem is None or not subelement:
        return None

    subel = xml_elem.find(subelement)
    if subel is None:
        text = default
    else:
        text = subel.text
        if text is None:
            text = default
        elif convert:
            try:
                text = convert(text)
            except:
                if quiet:
                    text = default
                else:
                    raise
    return text