What AnonyMonk is getting at is that you define sub buildXMLElements() { ... } to take no arguments and then pass it a bunch of arguments. This only works because you call the function in a way that defeats prototype checking. If you had enabled warnings, Perl would have chided you about this situation:
c:\@Work\Perl\monks>perl -le
"use warnings;
use strict;
;;
func('hi there');
;;
sub func () { print @_; }
"
main::func() called too early to check prototype at -e line 1.
hi there
Prototypes can be very useful for what they're useful for. But why use them in a way that defeats their purpose and also means you have to disable warnings so it won't nag you endlessly? Please see Prototypes in perlsub, and also the very enlightening Far More than Everything You've Ever Wanted to Know about Prototypes in Perl -- by Tom Christiansen.
Give a man a fish: <%-{-{-{-<
|