Models and model transformations constitute the basis of a set of software development techniques known as Model-Driven Development. In this context, UML State Machines have great potential for modeling the behavior of systems. In this work we are concerned with modeling the behavior of Product Lines, and their individual products. We present a process for deriving automatically a UML State Machine that models the behavior of a specific product from the UML model of a product line, via a model transformation based on Query/View/Transformation. The process directly involves the use of Feature Models in order to determine which elements of a (extended) State Machine describing a product family, will remain in the instantiation.