It's been a few years since I mucked around with modsecurity...
Will simply installing the package with the default rules provide enough validation to prevent any (okay, let's be honest - best we can hope for is "most") type of XSS? My assumption is no... and even if we consider only Type I - Reflected XSS.
What about the Core Rule Set? Is that XSS-proof enough?
If not, what kind of rules are missing, and what should I look to add/customize, maybe on a per-page basis? (uggh...)
Last part of the question, what about AJAX-heavy apps? How does ModSecurity, and in particular the CRS, handle AJAX requests without blocking them? I assume that hoping that it actually manages to parse out the AJAX and validate each parameter seperately would be too much to hope for...
To clarify, fixing the code to remove all XSS, including input validation and especially contextual output encoding, is of course the best way to go, and really the only long-term solution.
However, I was looking for a temporary, "quick fix", to pop something in place to protect the app for now, while they go and fix the XSS in the code, and search for more...