}
s = new DOMSource(d.getDocumentElement());
payload.getBodySources().set(0, s);
}
T t = tc.convertTo(type, s);
if (t instanceof Document) {
payload.getBodySources().set(0, new DOMSource(((Document)t).getDocumentElement()));
} else if (t instanceof Source) {
payload.getBodySources().set(0, (Source)t);
}