def element_from_dict(parent, data, element):
    """Create ``element`` to ``parent`` and sets its value to data[element], which
    will be removed from the ``data``.

    :param parent: parent element
    :type parent: Element
    :param data: dictionary where data[element] is desired value
    :type data: dict(str, str)
    :param element: name of the new element
    :type element: str
    :return: created element
    """
    el = ET.SubElement(parent, element)
    el.text = data.pop(element)

    return el