def smart_with_parent(smart_string):
    """Return lxml 'smart' string representation (UTF-8) with parent relation.

    lxml 'smart' string is a text node (atomic value) or an attribute node:
     * text node (tail, entity): contains text; never empty
     * attribute node: contains the value of the attribute
    """
    smart_repr = None
    parent_rel = None
    if smart_string.is_attribute:
        parent_rel = 'of'
        smart_repr = "@%s = '%s'" % (smart_string.attrname, smart_string)
    elif smart_string.is_text:
        parent_rel = 'in'
        if smart_string.isspace():
            smart_repr = 'whitespace'
        else:
            smart_repr = "'%s'" % smart_string
    elif smart_string.is_tail:
        parent_rel = 'after'
        if smart_string.isspace():
            smart_repr = 'tail whitespace'
        else:
            smart_repr = "tail '%s'" % smart_string
    return smart_repr, parent_rel
