def recursive_search(linkedlist, data):
    """Search 'linkedlist' recursively for a node containing 'data'.
    If there is no such node in the list, or if the list is empty,
    raise a ValueError.

    Inputs:
        linkedlist (SinglyLinkedList): a linked list.
        data: the data to search for in the list.

    Returns:
        The node in 'linkedlist' containing 'data'.
    """
    def _step(current):
        """Check the current node, and step right if not found."""
        if current is None:         # Base case 1: dead end.
            raise ValueError(str(data) + " is not in the list.")
        if current.value == data:   # Base case 2: the data matches.
            return current
        else:                       # Recurse if not found.
            return _step(current.next)

    return _step(linkedlist.head)