You can also add comments to an XML document. Comments go just about anywhere and are ignored for data processing purposes. Comments are bracketed by the <!– and –> character sequences. The following listing includes three valid comments:
<?xml version=”1.0″?>
<BooksList>
<!– This is an example . –>
<Book ISBN-13=” 978-0545139700” Title = Title>Harry Potter and the Deathly Hallows“>
<Author>J.K. Rowling</Author>
<Price>14.99</Price>
<Available>True</Available>
</Book>
<Book ISBN-13=”978-1451648539” Title=”Steve Jobs”>
<Author>Walter Isaacson</Author>
<Price>17.88</Price>
<Available>False <!– Why isn’t available ? –> </Available>
</Book>
<!– Other books omitted for clarity. –>
</BooksList>
The only place you can’t put a comment is embedded within a start or end tag (as in <myData <!– A comment should not go here –></myData>).