code: function(text)
      {
          text = text.replace(/\&/g, "&amp;");
          text = text.replace(/</g,  "&lt;");
          text = text.replace(/>/g,  "&gt;");
          text = text.replace(/'/g,  "&apos;");
          text = text.replace(/"/g,  "&quot;");
          return text;
      }
docs: /*  Function: xmlescape
  Excapes invalid xml characters.
  
  Parameters:
  (String) text - text to escape.
  
  Returns:
  Escaped text.