The approach called Topological Functioning Modeling for Model Driven Architecture (TFM4MDA) uses Topological Functioning Model (TFM) as a formal problem domain model. TFM is used as a computation independent model (CIM) within Model Driven Architecture (MDA). Following the recommendations of MDA a CIM must be transformed to a platform independent model (PIM). The object of this research is the construction of a UML class diagram on PIM level in conformity with the TFM. Nowadays this transformation is executed manually. Manual creation of models is time-consuming; also a probability exists, that a user (e.g., system architect) will make a mistake during the execution. Time investment and risk of making mistakes increase costs and reduce efficiency of TFM4MDA approach. That is why automation of this process is useful. The paper presents an algorithm for the transformation. The algorithm is written in pseudocode and can be implemented as a tool, thus improving the TFM4MDA approach.