Minor bug fixes, add separate entry point functions to transform_xml.php