3. The method of claim 1 wherein the comparison comprises: determining a first depth from a root element to a comparison element of the first XML document; determining a second depth from a root element to a corresponding comparison element of the second XML document; and performing compensation when the first depth is different from the second depth.
1. A method, implemented at least in part by one or more computing devices, for joining extensible markup language (XML) documents, the method comprising: by the one or more computing devices: performing a comparison of XML elements of a plurality of XML documents, wherein the comparison comprises counting a number of occurrences of one or more comparison elements in each of a first XML document and a second XML document; determining that the number of occurrences of the one or more comparison elements in the first XML document is less than the number of occurrences of the one or more comparison elements in the second XML document; based on the determining, obtaining join-selection elements from the first XML document of the plurality of XML documents; using the join-selection elements, obtaining join-required elements from the second XML document of the plurality of XML documents, wherein the join-required elements are required to perform an XML join between the first and second XML documents; and performing the XML join using the first XML document and the join-required elements from the second XML document.