A method for converting a legacy document into an XML document, includes
decomposing the conversion process into a plurality of individual
conversion tasks. A legacy document is decomposed into a plurality of
document portions. A target XML schema including a plurality of schema
components is provided. Local schema are generated from the target XML
schema, wherein each local schema includes at least one of the schema
components in the target XML schema. A plurality of conversion tasks is
generated by associating a local schema and an applicable document
portion, wherein each conversion task associates data from the applicable
document portion with the applicable schema component in the local
schema. For each conversion task, a conversion method is selected and the
conversion method is performed on the applicable document portion and
local schema. Finally, the results of all the individual conversion tasks
are assembled into a target XML document.