In recent years, software product line development has been adopted by a growing number of companies. Within software product line development, one way of creating specific products is by using configuration files to control a given set of parameters of the product at run time. Often, configuration files are created manually and this may lead to a sub-optimal process with respect to development effort and error proneness. In this experience report, we describe our work in enabling the automatic generation of configuration files in the railway domain. We discuss a four-step approach whose generation mechanism uses concepts of generative programming. The approach is the outcome of a bottom-up effort leveraging the experiences and the results from our technology transfer activities with our industrial partner, Bombardier Transportation. We evaluate the applicability and the correctness of the proposed approach using the Aventra train family from Bombardier Transportation.Besides, we evaluate the ability of the proposed approach in mitigating the development effort and error proneness typical of traditional manual approaches. We performed expert interviews to assess the industrial relevance of the proposed approach and collect qualitative feedback on the perceived benefits and drawbacks. Eventually, for each of the four steps composing the proposed approach, we identify factors that might affect the adoption of the approach and use these factors for discussing the lessons we have learned.