def string_literal(content):
    """
    Choose a string literal that can wrap our string.

    If your string contains a ``'`` the result will be wrapped in ``"``.
    If your string contains a ``"`` the result will be wrapped in ``'``.

    Cannot currently handle strings which contain both ``"`` and ``'``.
    """
    if '"' in content and "'" in content:
        raise ValueError('Cannot represent this string in XPath')
    if '"' in content:
        content = "'%s'" % content
    else:
        content = '"%s"' % content
    return content
