126 XML Today and Tomorrow — The Quiet Technology That Still Connects Our Digital World
The Technologies That Built the Web
When XML became a World Wide Web Consortium recommendation in 1998, it promised something that computer systems desperately needed: a standardized way to exchange structured information.
More than a quarter-century later, XML is no longer the fashionable technology it once was. JSON has become the preferred format for many modern web applications, and newer developers may encounter XML only occasionally.
Yet XML remains deeply embedded in the digital world. It powers podcast feeds, website sitemaps, vector graphics, office documents, government systems, financial transactions, and many specialized applications.
Understanding XML today means understanding not only the language itself, but also the tools and technologies that grew around it.
XML Is a Language for Describing Information
XML stands for Extensible Markup Language. Its purpose is to represent structured information using elements, attributes, and text.
Unlike HTML, which provides predefined elements for web documents, XML allows applications to define their own element names.
Consider a simple product record:
Walnut Table
Furniture
595.00
true
The XML describes the product without specifying how it should appear on a webpage.
A PHP application could read this information and create an HTML product listing. Another application could import it into an inventory system. A third could transform it into a different data format.
The same structured information can serve several purposes.
Understanding the XML Document Tree
One of the most important XML concepts is its tree structure.
Every well-formed XML document has one root element. That element can contain child elements, which may contain additional elements.
For example:
Walnut Table
595.00
Maple Chair
225.00
The catalog element is the root. Each product is a child of catalog, and each name and price is a child of its product.
This hierarchical structure makes XML especially useful for documents and information with nested relationships.
It also provides the foundation for technologies such as XPath and XSLT.
XPath: Finding Information Inside XML
XPath is a language for locating information within an XML document.
Its name comes from the idea of following paths through the XML tree.
Suppose an XML document contains hundreds of product records. An application might need to find all product names, locate one particular product, or identify products above a certain price.
XPath provides expressions for selecting those elements.
Consider these examples:
/catalog/product
This selects product elements that are direct children of the catalog root.
/catalog/product/name
This selects the name elements belonging to those products.
//product[@id='101']
This selects product elements with an id attribute equal to 101, wherever they occur in the document.
XPath can also evaluate conditions, select attributes, and navigate relationships between elements.
For developers familiar with SQL, XPath may feel conceptually similar to querying a database. Both allow software to locate particular information, although they operate on different data models.
SQL works with relational data. XPath navigates XML's hierarchical structure.
XSLT: Transforming XML Into Something Else
XPath helps locate information. XSLT helps transform it.
XSLT stands for Extensible Stylesheet Language Transformations.
It is a language designed to convert XML documents into other representations, including HTML, text, and different XML structures.
Imagine a company receiving a standardized XML product catalog. The company might use XSLT to transform that catalog into an HTML table for display on its website.
The original XML remains focused on describing the information, while the XSLT stylesheet defines how the information should be transformed.
For example, an XSLT stylesheet could take the name and price of each product and generate an HTML list.
Before server-side scripting and modern JavaScript frameworks became as widespread as they are today, XML and XSLT were especially attractive for separating information from presentation.
XSLT remains useful in document publishing, enterprise integrations, and systems that regularly convert large volumes of structured information.
XML Schema: Making Sure Information Is Correct
XML's flexibility is valuable, but it creates a challenge. If developers can invent their own elements, how can another application know whether a document contains the expected information?
XML Schema provides one solution.
An XML Schema Definition, commonly called an XSD, can describe which elements and attributes are permitted, which are required, their order, and what types of values they may contain.
For example, a product schema might require every product to contain a name and a price. It could specify that the price must be a decimal number.
An XML document containing a price such as "unknown" could then fail validation against that schema.
This distinction is important:
- Well-formed XML: Follows XML's basic syntax rules.
- Valid XML: Is well-formed and satisfies the rules of a particular schema or document type definition.
Validation becomes especially important when information moves between independent organizations.
A receiving application can check the structure before attempting to process the information.
XML Namespaces: Preventing Confusion
Because XML allows developers to create their own element names, different systems may use the same name to mean different things.
For example, one system might use a title element for the title of a book, while another uses title for a person's professional designation.
XML namespaces help distinguish these vocabularies.
A namespace associates element or attribute names with a namespace identifier, typically written as a URI.
Consider:
Understanding Wood
Professor
The book:title and person:title elements are distinct, even though both use the local name title.
The namespace URI identifies the vocabulary. It does not necessarily point to a webpage that must be downloaded.
Namespaces are particularly important when combining XML from different standards or applications.
PHP and XML: Working Together
PHP provides several tools for reading, creating, and processing XML.
One of the easiest to understand is SimpleXML, which represents XML elements through PHP objects.
Suppose a website receives this XML:
Walnut Table
595.00
PHP can read the document using SimpleXML:
name;
$price = (float) $xml->price;
echo htmlspecialchars($name, ENT_QUOTES, 'UTF-8');
echo ' - $' . number_format($price, 2);
?>
The code loads the XML file, retrieves the product name and price, and displays the information.
For trusted local files, SimpleXML can be a convenient solution. When processing XML from untrusted sources, applications should also consider parser security, resource limits, and external entity handling.
PHP also provides DOMDocument for more advanced document manipulation, XMLReader for efficient streaming of large XML documents, and XMLWriter for creating XML output.
These tools allow PHP applications to work with XML without manually interpreting its markup.
Generating XML With PHP
A PHP application can generate XML just as it generates HTML.
For example, a website could retrieve article records from MySQL and construct an RSS feed.
The application would send an appropriate XML content type, create the RSS structure, and insert the information retrieved from the database.
XMLWriter is especially useful because it handles element construction and escaping.
Here is a small example:
openMemory();
$xml->startDocument('1.0', 'UTF-8');
$xml->startElement('website');
$xml->writeElement('name', 'Zehr.net');
$xml->writeElement('category', 'Web Development');
$xml->endElement();
$xml->endDocument();
echo $xml->outputMemory();
?>
This produces an XML document containing the website name and category.
In a larger application, the values could come from MySQL rather than being written directly into the PHP code.
This is the same general principle used when dynamically generating podcast feeds and XML sitemaps.
XML and JSON: Which Should Developers Choose?
JSON has become the preferred format for many modern web APIs, particularly those designed for JavaScript applications.
It is compact, easy to generate, and supported by nearly every major programming language.
XML, however, offers features that JSON does not provide in quite the same way.
XML is especially useful when information contains both text and embedded markup, when documents must conform to established industry schemas, or when sophisticated transformation and namespace capabilities are required.
JSON is often preferable for relatively simple exchanges of application data.
For example, a website using JavaScript to request a list of products from a PHP application would commonly use JSON.
A podcast feed, on the other hand, would use XML because the RSS standard requires it.
The appropriate choice depends on the receiving system, the data structure, and the standards involved.
There is no need to use XML simply because it is available, nor should developers avoid it when it is the right tool.
XML in Today's Digital Infrastructure
XML continues to appear in many important areas of computing.
- Podcasting: RSS feeds distribute episode information to podcast applications.
- Search engines: XML sitemaps help communicate website URLs.
- Vector graphics: SVG uses XML syntax to describe scalable graphics.
- Office documents: Word and Excel formats use XML-based document structures.
- Enterprise integration: Established SOAP services and industry standards exchange XML messages.
- Publishing: XML supports structured documents, technical manuals, and content transformation.
- Government and finance: Standardized XML formats support reporting, records, and business transactions.
These applications demonstrate why XML has endured despite the popularity of newer alternatives.
XML and the Future of Structured Documents
XML's future is likely to be different from its early years.
During the early 2000s, some developers expected XML to become the universal format for exchanging information across the web.
Today, the computing world uses a variety of formats, including JSON, XML, CSV, Protocol Buffers, and specialized binary representations.
Each has strengths suited to particular applications.
XML is likely to remain important wherever document structure, long-term compatibility, validation, and established standards matter.
Large organizations cannot always replace existing information systems quickly or economically. XML-based integrations may continue operating for many years because they are dependable and already supported by extensive software infrastructure.
Meanwhile, podcasting, SVG graphics, and XML-based office documents provide continuing everyday uses.
Will Artificial Intelligence Change XML's Role?
Artificial intelligence introduces another interesting possibility for structured information.
AI systems often work with information from multiple sources, including documents, databases, websites, and application interfaces.
Structured formats can help make that information easier to process consistently.
JSON is widely used in modern AI application interfaces, but XML can also represent structured content, particularly when information comes from existing document collections or enterprise systems.
AI tools may also make it easier to convert XML into other formats, interpret unfamiliar XML schemas, and maintain older integrations.
Rather than eliminating XML, these capabilities may help organizations continue using valuable structured information regardless of its original format.
Should Web Developers Learn XML Today?
For a developer working primarily with PHP, MySQL, HTML, CSS, and JavaScript, XML does not necessarily need to become an everyday programming language.
However, understanding its fundamentals is valuable.
A practical knowledge of XML helps developers recognize RSS feeds, understand sitemaps, troubleshoot malformed documents, work with external services, and recognize the differences between data storage and data exchange.
Developers do not need to memorize every XML-related standard. Knowing what XML does and which tools are available is often enough to begin solving a problem.
When a project requires XML, PHP provides mature libraries for handling it.
Looking Ahead
XML represents an important chapter in the evolution of the web. It helped establish the idea that structured information could move between independent computer systems using open, standardized formats.
That idea remains essential today.
Modern developers have more choices than ever, and XML is no longer the automatic answer to every information exchange problem.
Yet it continues supporting systems that millions of people rely upon, often without knowing XML is involved.
From a podcast episode appearing in an app to an SVG image displayed on a website, XML quietly continues doing its work.
The future of XML may not be about dominating the web. It may be about continuing to connect the systems, documents, and technologies that depend on it.

Brad Zehr | Zehr.net | brad@zehr.net
About Services Why A Site Site Ideas Topics Podcast Help Contacts