<?xml version="1.0" encoding="UTF-8"?>
<!-- Sample XML Document demonstrating various features -->
<!-- Root element with namespace declaration -->
<library xmlns:book="http://example.com/books" xmlns:author="http://example.com/authors">
<!-- Element with multiple attributes -->
<book:collection id="scifi-classics" category="Science Fiction" year="2024">
<!-- Nested elements with different structures -->
<book:item isbn='978-0-441-17271-9' format="hardcover">
<book:title>Neuromancer</book:title>
<author:name>William Gibson</author:name>
<book:published>1984</book:published>
<!-- Entity references -->
<book:description>
A "cyberpunk" masterpiece that defined a genre.
The story follows Case, a washed-up computer hacker & console cowboy.
</book:description>
<!-- CDATA section for preserving special characters -->
<book:code-snippet>
<![CDATA[
if (condition < 10 && value > 5) {
console.log("Special chars: <>&\"'");
}
]]>
</book:code-snippet>
</book:item>
<book:item isbn="978-0-441-00590-0" format="paperback">
<book:title>Dune</book:title>
<author:name>Frank Herbert</author:name>
<book:published>1965</book:published>
<book:description>
Set on the desert planet Arrakis, where "spice" is the most valuable substance.
Winner of both Hugo & Nebula awards.
</book:description>
<!-- Self-closing tags -->
<book:available/>
<book:bestseller/>
</book:item>
</book:collection>
<!-- URL encoding in attributes -->
<book:reference
url="http://example.com/catalog?id=123&category=scifi"
encoded="%20%2F%3A%3F%3D">
External catalog link
</book:reference>
<!-- Multi-line comment
demonstrating various
XML features and patterns -->
<!-- Common XML entities -->
<book:entities>
< Less than
> Greater than
& Ampersand
" Quote
' Apostrophe
Non-breaking space
</book:entities>
<!-- Mixed content with both text and elements -->
<book:description>
This is <book:emphasis>mixed content</book:emphasis> with both
text nodes and <book:strong>element nodes</book:strong> together.
</book:description>
<!-- Complex CDATA with nested structure -->
<book:template>
<![CDATA[
<html>
<body>
<h1>Title</h1>
<p>Content with <, >, & symbols</p>
</body>
</html>
]]>
</book:template>
</library>