public static String toMessageString(Throwable t) {
        StringBuilder b = new StringBuilder();
        String lastMessage = null;
        String message;
        for (; t != null; t = t.getCause()) {
            message = t.getMessage();
            if (message == null) continue;
            if (message.equals(lastMessage)) continue;
            if (!b.isEmpty()) {
                b.append(": ");
            }
            b.append(message);
            lastMessage = message;
        }
        return b.toString();
    }
Creates a deployment spec from XML.

@throws IllegalArgumentException if the XML is invalid
config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java