#6132: Refactor XSS code
Merge pull request #6134 from dotCMS/issue-6132-refactor-xss

#6132: Refactor XSS code