How can i put php code on the wordpress page?

I think using the user_registration hook is probably the best fit for what you want to do.

An example from the docs:

add_action( 'user_register', 'myplugin_registration_save', 10, 1 );

function myplugin_registration_save( $user_id ) {

    if ( isset( $_POST['first_name'] ) )
        update_user_meta($user_id, 'first_name', $_POST['first_name']);

}

To be compliant with the WordPress way (and be less likely to get into trouble if you change servers), you should probably use WP’s HTTP API to send the XML to the other URL.

404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.