Namespaces were designed to solve a problem that arises when using multiple markup languages in a single document. For example, a chemistry book might use a chemistry markup language when talking about the <formula> for sulfuric acid, but would use a math markup language to talk about the mathematical <formula> for calculating the acidity of a solution.
By associating a prefix with each markup language, it's possible to combine them in one document without having the names collide with one another, since each <formula> is in its own space. Thus, the book starts out like this:
<book xmlns="http://www.book-o-matic.org/bookXML" xmlns:chem="http://chemistry.org/chemspec" xmlns:math="http://www.mathstuff.org/mathdocs">
The three namespace attributes mean that:
Although the identifiers look like web addresses, they don't have to point to any valid web page. Since every XML specification has to have a unique identifier, it was decided to use Uniform Resource Identifiers (web addresses), since they can uniquely identify a developer or organization.
Once namespaces are established, an author can write this portion of the book without fear of conflicting names:
<paragraph> We combine sulfuric acid, <chem:formula>H2SO4</chem:formula>, with water, <chem:formula>H2O</chem:formula> and determine its acidity by calculating <math:formula>acid / (water+acid)</math:formula>. </paragraph>