XML data fusion algorithm in JAVA, using BaseX to store and retrieve XML