XSS is already detected by various tools such as Burp and Acunetix; XSS Validator comes in handy. It is a Burp intruder extender that has been designed to automatically validate XSS vulnerabilities.
XSS Validator is based on SpiderLabs' blog post:
http://blog.spiderlabs.com/2013/02/server-site-xss-attack-detection-with-modsecurity-and-phantomjs.html
http://blog.spiderlabs.com/2013/02/server-site-xss-attack-detection-with-modsecurity-and-phantomjs.html