In this paper, a very easy, numerically stable and computationally efficient method is presented, which allows the modeling and simulation of a flexible robot with high precision. The proposed method is developed under the hypotheses of flexible links having varying cross sections, of large link deformations and of time-varying geometrical and/or physical parameters of both the robot and the end-effector. This methodology uses the same approach of the modeling of rigid robots, after suitably and fictitiously subdividing each link of the robot into sublinks, rigid to the aim of the calculus of the inertia matrix and flexible to the aim of the calculus of the elastic matrix. The static and dynamic precision of the method is proved with interesting theorems, examples and some experimental tests. Finally, the method is used to model, control, and simulate a crane, composed of three flexible links and a cable with varying length, carrying a body with a variable mass.