The simplest approach is to make two passes over your data. Do apply-templates mode="correct" to output the correct entries, then apply-templates mode="incorrect" to output the errors.
Of course that means testing each one twice. The alternative, which may be more efficient, is to output each one as it is first encountered, and then do a sort so that the correct ones appear first.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference