 
         msg
 
+class CheckstyleReporter extends Reporter
+
+    publish : () ->
+        @print "<?xml version=\"1.0\" encoding=\"utf-8\"?><checkstyle version=\"4.3\">"
+
+        for path, errors of @errorReport.paths
+            if errors.length
+                @print "<file name=\"#{path}\">"
+
+                for e in errors
+                    @print """
+                    <error line="#{e.lineNumber}"
+                            severity="#{@escape(e.level)}"
+                            message="#{@escape(e.message)}; context:#{@escape(e.context)}""
+                            source="coffeelint"/>
+                    """
+                @print "</file>"
+
+        @print "</checkstyle>"
+
+    escape : (msg) ->
+        # Force msg to be a String
+        msg = "" + msg
+        unless msg
+            return
+        # Perhaps some other HTML Special Chars should be added here
+        # But this are the XML Special Chars listed in Wikipedia
+        replacements = [
+            [/&/g, "&amp;"]
+            [/"/g, "&quot;"]
+            [/</g, "&lt;"]
+            [/>/g, "&gt;"]
+            [/'/g, "&apos;"]
+            ]
+
+        for r in replacements
+            msg = msg.replace r[0], r[1]
+
+        msg
+
 # Return an error report from linting the given paths.
 lintFiles = (paths, config) ->
     errorReport = new ErrorReport()

        new JSLintReporter(errorReport)
    else if options.argv.csv
        new CSVReporter(errorReport)
    else
        colorize = not options.argv.nocolor
        new Reporter(errorReport, colorize)

                "Used with --stdin to process as Literate CoffeeScript")
            .boolean("csv")
            .boolean("jslint")
            .boolean("checkstyle")
            .boolean("nocolor")
            .boolean("noconfig")
            .boolean("makeconfig")
