A method and system for modifying program applications of a legacy
computer system to directly output data in XML format models the legacy
computer system, maps the model to an XML schema and automatically
modifies one or more applications to directly output XML formatted data
in cooperation with a writer engine and a context table. A modeling
engine lists the incidents within the applications that write data and
generates a report data model. The report data model includes statically
determined value or type of the data fields and is written in a formal
grammar that describes how the write operations are combined. A
modification specification is created to define modifications to the
legacy computer system applications that relate applications that write
data to the XML schema. A code generation engine then applies the
modification specification to the applications to write modified
applications that, in cooperation with a writer engine and context table,
directly output XML formatted data from the legacy computer system
without a need for transforming the data.