in reply to Use of uninitialized value in string comparison (cmp)
Firstly - I think it is better to isolate and _minimize_ the problem definition; shorter and indented XML document might be better for reading. My experience is that I often solve my problem when I minimize it...
Secondly - I GUESS that you try to sort elements which do not have attribute "type".
In Section
Seekers of Perl Wisdom