LanguageTool is a style and grammar checker that currently supports English, Polish, German, French, Dutch, and other languages to a different degree. It scans the words and their part-of-speech tags for occurrences of error patterns, which are defined in an XML file. More powerful error rules can be written in Java.
XML-Grammar-Fiction is a Perl package that provides processors for lightweight markup languages and corresponding XML grammars for writing prose (e.g. stories, novels, and novellas) as well as screenplays. The XML grammars can in turn be translated to XHTML and DocBook/XML. XML-Grammar-Fiction currently offers only very basic functionality, but has good support for UTF-8 and allows one to write bidirectional texts conveniently. It is still under development and may exhibit some quirks.