def METHOD_NAME(function_space):
    "Return a new function space with all non-UFL information removed."
    if isinstance(function_space, FunctionSpace):
        return FunctionSpace(strip_domain(function_space.ufl_domain()),
                             function_space.ufl_element())
    elif isinstance(function_space, TensorProductFunctionSpace):
        subspaces = [METHOD_NAME(sub) for sub in function_space.ufl_sub_spaces()]
        return TensorProductFunctionSpace(*subspaces)
    elif isinstance(function_space, MixedFunctionSpace):
        subspaces = [METHOD_NAME(sub) for sub in function_space.ufl_sub_spaces()]
        return MixedFunctionSpace(*subspaces)
    else:
        raise NotImplementedError(f"{type(function_space)} cannot be stripped")