in reply to How to check xml elements?

You could try XML::Validator::Schema for a start. But I've never used it, so searching for "schema" on CPAN might yield better modules.