<?php
  
  $post_information = array(
    'post_title' => wp_strip_all_tags( $name.' - '.$email ),
    'post_type' => 'xs_register_list',    
    'post_status' => 'publish'
  );   

$post_ID = wp_insert_post( $post_information );

update_post_meta($post_ID, 'xs_register_email', $email);
update_post_meta($post_ID, 'xs_register_message', $comment);
update_post_meta($post_ID, 'xs_register_name', $name);
update_post_meta($post_ID, 'xs_register_phone', $phone);
//update_post_meta($post_ID, 'xs_register_package', $package);

	$arr = array('result' => 'success' );
	echo json_encode($arr);
	wp_die(); // this is required to terminate immediately and return a proper response