I know there are quite some threads talking about validating XML file against its XML schema, such as : validate-xml-using-libxml and xml-schema-validation-with-relaxng
So if there is a simple Perl module on CPAN that can test this with minimal code, then that would be very fantastic to know.
You can simply use XML::Parser.
Note that your question title refers to being well-formatted (well-formed?) whereas the body refers to validation. If you want to validate (against a schema) check out XML::Validator::Schema.