code: public static XNElement createUpdate(String function, XNSerializable object) {
          XNElement result = new XNElement(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