An XML comment encountered outside the document type declaration is represented by the Comment value syntax element. The value of the element is the comment text from the XML message.
If the value of the element contains the character sequence -->, the sequence is replaced with the text -->. This ensures that the contents of the comment cannot prematurely terminate the comment. Occurrences of <, >, &, ", and ' are not translated to their escape sequences.
Examples of the XML comment in an XML document and in tree structure form are shown below:
<example><!-- This is a comment --></example>