In many areas modeling and simulation plays an important role. Currently, an equation-based object oriented modeling and simulation languages, such as Modelica, are used for multi-domain modeling, and the OpenModelica Compiler (OMC) is Modelica-based platform for modeling, compilation and simulation. In this thesis, we address two issues relevant to OMC. The first issue deals with translation from the internal equation-based model representation in OpenModelica to an Extensible Markup Language (XML) form which can be imported in to the CasADi open source toolkit, in order to enable integrated dynamic modeling and optimization. To achieve this, we have implemented a new template based XML code generator module in OMC based on an XML standard defined in OPENPROD EU project for representation of flattened Modelica model. The second issue deals with transformation of OpenModelica Abstract Syntax Tree (AST) into Modelica text (Unparser). With regard to this issue, we have implemented a new template based Modelica Unparser from OpenModelica AST into Modelica text.