XML – Tags

XML tags are the starting and ending points of an element. They are basic things to know before we are writing a XML code. For every starting tag there should be an ending tag in the correct order.

Example:

From the above example:

we can identify the start and end tags.

Data is given between these start and end tags. If there is no data between the start and end tags, that can be called as Empty Tag.

Example:

When we are writing the XML code, we need to ensure the correct syntax and order of elements.

Below are some wrong examples:

Example 1:

Example 2: