In an XML document a considerable fraction consists of markup, that is, begin and end-element tags describing the document's tree structure. XML compression tools such as XMill separate the tree structure from the data content and compress each separately. The main focus in these compression tools is how to group similar data content together prior to performing standard data compression such as gzip, bzip2, or ppm. In contrast, the focus of this paper is on compressing the tree structure part of an XML document. The authors use a known algorithm to derive a grammar representation of the tree structure which factors out the repetition of tree patterns.