We consider the problem of the existence and uniqueness of solutions to a semilinear equation in a Hilbert space, of the type Lu = Nu, where the linear operator L is assumed to be anti-selfadjoint, and the nonlinear part N is controlled by two bounded selfadjoint operators A and B. As an example of application, we study the existence and uniqueness of periodic solutions for a system of transport equations. Precisely, we look for solutions which are periodic in each of their variables, the periods being determined by the forcing term.