SGML (Standard Generalized Markup Language) is a standard that indicates how to specify document markup.
It is just a Meta language that describes how marking should be documented.
HTML is a markup language that is described using SGML.
You will always find the attribute “DOCTYPE” at the top of the HTML page that defines which DTD (document type definition) is used for analysis purposes.
XHTML was created from XML which was used in HTML 4.0. for the example in SGML secured HTML “ ” is not valid but in XHTML it is valid. You can refer XML DTD ( document type definition ) as shown in the below code snippet.