A (d-parameter) basic nilsequence is a sequence of the form psi(n) = f(a(n)x), n is an element of Z(d), where x is a point of a compact nilmanifold X, a is a translation on X, and f is an element of C(X); a nilsequence is a uniform limit of basic nilsequences. If X = G/Gamma is a compact nilmanifold, Y is a subnilmanifold of X, (g(n))(n)is an element of Z(d) is a polynomial sequence in G, and f is an element of C(X), we show that the sequence phi(n) = integral Y-g(n) f is the sum of a basic nilsequence and a sequence that converges to zero in uniform density (a null-sequence). We also show that an integral of a family of nilsequences is a nilsequence plus a null-sequence. We deduce that for any invertible finite measure preserving system (W, B, mu, T), polynomials p(1),..., p(k) : Z(d) -> Z, and sets A(1),..., A(k) is an element of B, the sequence phi(n) = mu(T(p1(n))A1 boolean AND ... boolean AND T(pk(n))A(k), n is an element of Z(d), is the sum of a nilsequence and a null-sequence.