Question:medium

A developer is creating a data file to store structured information about books. The file must be self-descriptive, allow custom tags, and ensure that all tags are properly nested and closed. Which of the following XML snippets is well formed?

Show Hint

XML is all about Balance. Every ‘<tag>‘ needs a ‘</tag>‘, and they must be closed in the exact reverse order they were opened (LIFO - Last In First Out).
Updated On: Jul 4, 2026
  • <book><title>XML Guide<title><author>John</author></book>
  • <book><title>XML Guide</title><author>John</author></book>
  • <book><title>XML Guide</author><author>John</title></book>
  • <book><title>XML Guide</title><author>John</book>
Show Solution

The Correct Option is B

Solution and Explanation

Was this answer helpful?
0