Create a list of pages excluding children of selected page

//Create an array containing the IDs of pages that are children of page ID XXX
$args = array(
'post_type' => 'page',
'post_parent' => XXX,
'fields' => 'ids',
'posts_per_page' => -1,
);
$qry = new WP_Query($args);

//Convert the array into a string
$string = implode(', ', $qry->posts);

//Display the list of IDs - for testing purposes.
//var_dump($string);                

//Create a list of all pages excluding the list of child pages
wp_list_pages(array('exclude' => 'XXX,'.$string, 'title_li' => ''));