code: function resultsAsXml() {
              var date = new Date(),
                  totalSpecs = totalSpecsDefined || totalSpecsExecuted,
                  disabledSpecs = totalSpecs - totalSpecsExecuted + totalSpecsDisabled,
                  skippedSpecs = totalSpecsSkipped + disabledSpecs;
  
              var xml = '<?xml version="1.0" encoding="utf-8" ?>';
              xml += '\n<test-results name="' + escapeInvalidXmlChars(self.reportName) + '"';
              xml += ' total="' + totalSpecs + '"';
              xml += ' failures="' + totalSpecsFailed + '"';
              xml += ' not-run="' + skippedSpecs + '"';
              xml += ' date="' + dateString(date) + '"';
              xml += ' time="' + timeString(date) + '"';
              xml += ">";
  
              for (var i=0; i<suites.length; i++) {
                  xml += suiteAsXml(suites[i], " ");
              }
              xml += "\n</test-results>";
              return xml;
          }
docs: ****** Helper functions with closure access for simplicity *******