You're welcome. But you really shouldn't find it "surprisingly very effective." Perl excels at text transformation. XML is text. Changing all occurrences of <foo/> to <foo></foo> in an XML document is a trivial transformation (unless it isn't due to some rare and unlikely edge case).