It may need to be installed, but it really good at checking encodings, xml schemas etc..
http://xmlsoft.org/xmllint.html
xmllint --valid --noout test.xml
- worked for Rob H.
A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.