Thanks for promtly reply.
I want to use try this
builder.addBinaryBody("data", dataXml.getBytes();
builder.addTextBody("template","crx://content/dam/formsanddocuments/XSDBasedForm.xdp",
ContentType.TEXT_PLAIN);
instead of
builder.addBinaryBody("data", files[i]);
builder.addBinaryBody("template", xdpTemplate);
Any clue if this is correct? API response is 500.