in reply to Regular expression to check XML type

One thing jumps out (at me anyway:-)...

Your RE contains XML, the string you want to match contains xml and you haven't used the i (ignore case) modifier (see perlre).

A user level that continues to overstate my experience :-))