XML documents and other tree structures can be thought of as members of a mathematical group.