private XElement GetTypeTableCell(ElementDefinitionType[] types, SDTreeNode associatedTreeNode = null)
        {
            string result = string.Empty;

            if (types == null)
            {
                if (associatedTreeNode != null)
                {
                    ElementDefinition associatedElement = associatedTreeNode.Element;

                    if (associatedElement.nameReference != null)
                    {
                        if (!string.IsNullOrWhiteSpace(associatedElement.nameReference.value))
                        {
                            return(Html.Td("(see element " + associatedElement.nameReference.value + ")"));
                        }
                    }
                }

                return(Html.Td(string.Empty));
            }

            if (types.Length == 0)
            {
                return(Html.Td(string.Empty));
            }
            else if (types.Length == 1)
            {
                ElementDefinitionType type = types.Single();

                if (type.IsReference())
                {
                    return(Html.Td(GetReferenceTypeName(new ElementDefinitionType[] { type })));
                }
                else if (type.IsExtension())
                {
                    uri profileUri = type.profile.WhenNotNull(t => t.FirstOrDefault());

                    if (profileUri != null)
                    {
                        StructureDefinition structureDefinition = _resourceFileSet.GetStructureDefinition(profileUri.value);

                        if (structureDefinition.IsComplexExtension())
                        {
                            return(Html.Td("(complex extension)"));
                        }
                        else
                        {
                            ElementDefinitionType[] elementDefinitionTypes = structureDefinition.GetSimpleExtensionType();
                            return(GetTypeTableCell(elementDefinitionTypes));
                        }
                    }
                    else
                    {
                        return(Html.Td(string.Empty));
                    }
                }
                else
                {
                    return(Html.Td(GetNonReferenceTypeName(type)));
                }
            }
            else
            {
                if (types.All(t => t.IsReference()))
                {
                    return(Html.Td(GetReferenceTypeName(types)));
                }

                return(Html.Td(types.Select(t => GetNonReferenceTypeName(t)).Intersperse(" | ")));
            }
        }