For a sample XHTML document, study the text of
XML in 10 points
(by Bert Bos). Here is a local copy of the text.
(Its document type declaration has been stripped off; This will force it into the "tree view" when loaded into Firefox.)
Check out the The XML C parser and toolkit of Gnome Web page. Download and install the software in your PC!
The toolkit includes xmllint, a program for checkig the well-formedness and validity of XML documents.
Link: http://xmlsoft.org/.
Link (xmllint): http://xmlsoft.org/xmldtd.html.
Check out the online Markup Validation Service from W3C! It validates all sorts of XML documents!
Link: http://validator.w3.org/.