in reply to Comparing HTML snippets

You might want to take a look at XML::SemanticDiff