Thank you very much for the effort. Once thing I noticed is it matters where I place the line "my $report = $doc->createElement("REPORT");" if I placed it outside the while loop and then remove the "else" to replace it with the statement "if ($person_pin eq $copy_person_pin)"
then all my 'CHARGE' tag start appearing in the XML but then the XML struct is altered.
I am beginning to believe XML:LibXML is very funky.