}
private static byte[] decodeHex(final String literal) throws DynamicError {
final int len = literal.length();
if((len & 1) != 0) {
throw new DynamicError("err:FORG0001", "A xs:hexBinary value MUST contains an even number of characters, but was '"
+ literal + '\'');
}
final byte[] binaryValue = new byte[len / 2];
for(int i = 0, j = 0; i < len; i += 2, j++) {
binaryValue[j] = (byte) ((decodeHex(literal, i) << 4) + decodeHex(literal, i + 1));