code: public static XElement createUpdate(String function, XSerializable object) {
          XElement result = new XElement(function);
          object.save(result);
          return result;
      }
docs: Create an update request and store the contents of the object into it.
  @param function the remote function name
  @param object the object to store.
  @return the request XML