in reply to Question on XML output using Perl

Your code isn't complete enough to answer your question, see How (Not) To Ask A Question