docs: function (name)
      {
          if (!name) { return null; }
  
          var node = Strophe.xmlGenerator().createElement(name);
  
          // FIXME: this should throw errors if args are the wrong type or
          // there are more than two optional args
          var a, i, k;
          for (a = 1; a < arguments.length; a++) {
              if (!arguments[a]) { continue; }
              if (typeof(arguments[a]) == "string" ||
                  typeof(arguments[a]) == "number") {
                  node.appendChild(Strophe.xmlTextNode(arguments[a]));
              } else if (typeof(arguments[a]) == "object" &&
                         typeof(arguments[a].sort) == "function") {
                  for (i = 0; i < arguments[a].length; i++) {
                      if (typeof(arguments[a][i]) == "object" &&
                          typeof(arguments[a][i].sort) == "function") {
                          node.setAttribute(arguments[a][i][0],
                                            arguments[a][i][1]);
                      }
                  }
              } else if (typeof(arguments[a]) == "object") {
                  for (k in arguments[a]) {
                      if (arguments[a].hasOwnProperty(k)) {
                          node.setAttribute(k, arguments[a][k]);
                      }
                  }
              }
          }
  
          return node;
      }