1. A method performed by a data processing apparatus, the method comprising: identifying pairs of document object model content nodes where a first content node in each pair is in a first hierarchical representation of a first document and a second content node in each pair is in a second hierarchical representation of a second document, in which the content nodes represent visible content and in which identifying comprises: selecting the first and second content nodes such that a cost based on structural differences between the first and second hierarchical representations and a content difference between the first and second content nodes is minimized, wherein the cost is based on, at least, a distance of a shortest path between the first and second content nodes given a common ancestor node in the document object model; associating rendered layout information related to the first content node with the second content node; and determining whether to generate a snippet for the content difference between the first and second content nodes based on the rendered layout information.