1. A method for transforming a source XML document satisfying a source DTD into a target XML document satisfying a target DTD, the method comprising: transforming the source XML document into a source document tree, wherein the source XML document satisfies a first XML grammar and the source document tree satisfies a second XML grammar; converting the source document tree into a target document tree satisfying the second XML grammar; and transforming the target document tree into the target XML document, wherein the target XML document satisfies the first XML grammar.