You might want to take a look at XML::SemanticDiff
In reply to Re: Comparing HTML snippets by KevinZwack in thread Comparing HTML snippets by szabgab