Solutions of the Einstein equations involving functions of only one variable