The electronic health record (EHR) enabled the cost-efficient handling and processing of health information. By storing medical documents in digitized form, the EHR ensures the fast and reliable availability of health information. However, as not all health care providers use the same EHR format and health document structures, the efficiency of the data sharing process is severely reduced. In this paper we present a rule-based transformation system that converts semi-structured (annotated) text into standardized formats, such as HL7 CDA. Our approach identifies relevant information in the input document by analyzing its structure as well as its content and inserts the required elements into corresponding reusable CDA templates, where the templates are selected according to the CDA document type-specific requirements. The research results enable the efficient transformation of various EHR structures into a standardized format and therefore contribute to increasing the data sharing efficiency across health care providers.