adding array_to_xml to BaseClass