public static byte[] decodeHex(String hex) {
        return DatatypeConverter.parseHexBinary(hex);
    }
Turns a hex encoded string into a byte array. It is specifically meant
to "reverse" the toHex(byte[]) method.

@param hex a hex encoded String to transform into a byte array.
@return a byte array representing the hex String[
xmppserver/src/main/java/org/jivesoftware/util/StringUtils.java