} else if (c == Short.class) {
w.writeShort((Short) o);
} else if (c == Duration.class) {
w.writeCharacters(((Duration) o).toString());
} else if (c == XMLGregorianCalendar.class) {
w.writeCharacters(((XMLGregorianCalendar) o).toXMLFormat());
} else if (c == byte[].class) {
BinaryUtils.encodeBytes(w, (byte[]) o);
} else {
context.createWriter().write(w, o);
}