XML – Comments

XML Comment is used to mention the brief description or the small note about the XML code. Even though the elements are self-descriptive, we may require the comment at some places. There is no difference between HTML comments and XML comments syntax. Both will have same syntax.

Syntax:

Example:

Also, we should be careful about the placement of comments. Comments can be placed before the XML declaration or anywhere in the XML document but nor inside element tags or attributes.