This paper proposes a novel approach to measuring XML document similarity by taking into account the semantics between XML elements. The motivation of the proposed approach is to overcome the problems of “under-contribution” and “over-contribution” existing in previous work. The element semantics are learned in an unsupervised way and the Proportional Transportation Similarity is proposed to evaluate XML document similarity by modeling the similarity calculation as a transportation problem. Experiments of clustering are performed on three ACM SIGMOD data sets and results show the favorable performance of the proposed approach. Categories and Subject Descriptors: H.3.3 [Information Storage and Retrieval]: Information Search and Retrieval – clustering General Terms: Theory, Experimentation