Exploitation of Similarity and Pattern Matching in XML Technologies ( Technical Report )