code: public ArgumentsWriter getArgumentsWriter(Object[] arguments) {
  		Params.notNullOrEmpty(arguments, "Arguments");
  
  		int streams = 0;
  		int documents = 0;
  		for (Object argument : arguments) {
  			if (argument instanceof StreamHandler) {
  				++streams;
  			}
  			if (argument instanceof Document) {
  				++documents;
  			}
  		}
  
  		if (arguments.length == 1) {
  			if (documents != 0) {
  				return new XmlArgumentsWriter();
  			}
  			if (streams != 0) {
  				return new StreamArgumentsWriter();
  			}
  		}
  		if (documents != 0) {
  			return new MixedArgumentsWriter();
  		}
  		if (streams != 0) {
  			return new MixedArgumentsWriter();
  		}
  
  		return new JsonArgumentsWriter();
  	}
docs: Factory method for arguments writers. Current implementation choose the {@link ArgumentsWriter} implementation based on
  given arguments list. It is caller responsibility to ensure arguments order and types match remote method signature.
  <p>
  Heuristic to determine arguments writer:
  <ul>
  <li>uses {@link XmlArgumentsWriter} if there is a single argument of type {@link Document},
  <li>uses {@link StreamArgumentsWriter} if there is a single argument of type {@link StreamHandler},
  <li>uses {@link MixedArgumentsWriter} if there are more documents and/or streams present,
  <li>otherwise uses {@link JsonArgumentsWriter}.
  </ul>
  
  @param arguments invocation arguments list, not null or empty.
  @return parameters encoder instance.
  @throws IllegalArgumentException if given arguments list is null or empty.