static XmlElement encodeScript(XmlDocument doc, Script script)
 {
     XmlElement e = null;
     if (script != null)
     {
         e = doc.CreateElement("", "script", "");
         e.SetAttribute("name", script.getName());
         e.SetAttribute("language", script.getLanguage());
         e.AppendChild(doc.CreateTextNode(script.getCode()));
     }
     return e;
 }