private String formatClassElementLabel(ClassElement element) {
        StringBuilder formatted = new StringBuilder();
        if(direction.equals("TD") || direction.equals("DT")) {
            formatted.append('{');
        }

        List<String> stereotypes = element.getStereotypes();
        if(!stereotypes.isEmpty()) {
            // TODO investigate HTML label...
            //formatted.append("<FONT POINT-SIZE=\"").append(nodeStereotypeFontSize).append("\">");
            //formatted.append("<I>");
            for(String stereotype : stereotypes) {
                formatted.append(ensureTextIsValid(stereotype)).append("\\n");
            }
            //formatted.append("</I>");
            //formatted.append("</FONT>");
        }
        formatted.append(ensureTextIsValid(element.getClassName()));

        formatClassFeatures(formatted, element.getAttributes());
        formatClassFeatures(formatted, element.getMethods());

        if(direction.equals("TD") || direction.equals("DT")) {
            formatted.append('}');
        }

        return formatted.toString();
    }