encode xml function was not accessible to other modules.  added to public function return