1. A method for converting a legacy or proprietary document into extensible mark-up language format, comprising: creating an input document schema tree with nodes; labeling input document schema tree nodes with valid labels and/or paths from an extensible markup language format for an output document; composing labeled input document schema tree nodes into an output document schema tree with a valid structure; determining a traversal of the input document schema tree to obtain a correct composition of the output document schema tree and correct application of structural rules; and applying the determined traversal to transform the input document to the output document.