Web 1.0 was / is about
tagging by using html. HTML has been extended to
XHTML, a reformulation of HTML 4 in XML 1.0. A XHTML document has to be well-formed in the same way as a XML document.
More and more websites will be
XML driven, where XML documents are transformed to the preferred format using
XSL Transformations (XSLT). You have one datasource, but many uses. The XML document may be transformed to (X)HTML, PDF, WAP or other XML formats like RSS and Atom etc. The sky is the limet, and possible formats are increasing. XML is also an important, but not necessary element, in web applications made by the
AJAX technologies. For exmaple
flickr combines AJAX and Flash. These webapplications are as mentioned often driven by XML archived XML documents or XML documents pulled from a database like MySQL using the now object oriented scripting language PHP. PHP 5.0 and above have important extensions to manipulate XML documents. This makes XML driven sites extremely flexible and efficient and will be used by large companies to get a better control of their document structure and quality.
A
well-formed XML document is one that is written using legal XML syntax and structure according to the XML specification. A
valid document is one that is well-formed and conforms to a structure outlined in a
DTD (Document Type Definition) or a schema like
XML schemas or
RELAX NG.
Of these three technologies, XML Schema, made and developed by the world wide web consortiom,
W3C is the most complex, but also the most effective and
"open the door to great possibilities in flexibility and granularity when dealing with a document's structure".
Source: Robert Richards (2006): "Pro PHP XML and Web Services."
This type of controlling documents will be used by large companies and institiutions in the future and small companies may use part of the technology to drive their online documents.
HTML tagging will still be used effectively for brochure like websites etc.
You find tutorials on most of the above mentioned technologies on the excellent web site
W3 Schools.
If you need additional and deeper information, I can reccommend the above book that is one of the best IT related books I have ever read.
Conclusion:
A well-formed XML document need not be valid, but a valid XML document must be well-formed.