What is the best way, programmatically, to iterate through a view's results? Given a view, named 'Children' (with two fields: child_node_id and a birth_order_value) what is the best way, programmatically, to iterate through the views results set given a display_id of 'default' and an argument that contains the parent node id?

Previously, I have used the View in a block using code similar to the following:

if ( arg(0) == 'node' &amp;&amp; is_numeric(arg(1)) &amp;&amp; ! arg(2)) {
   $node = node_load(arg(1));
   $args = array($node-&gt;nid);
   $view = views_get_view('Children');
   print $view-&gt;preview('default', $args);
}


However, in another block I want to perform some logic based on the values found in the view.  You might be able guess that business logic based on my final requirement: I want the block of code supporting the view ('Children') be called multiple times. As I iterate through the view dataset results, I want to recursively iterate through the children nodes querying for their children.
Playing around with Views a bit I seem to have worked out an approach. However, I'd like to leave my question open to other answers and better solutions.

&lt;?php
if ( arg(0) == 'node' &amp;&amp; is_numeric(arg(1)) &amp;&amp; ! arg(2) ) {
   $node = node_load(arg(1));
   $args = array($node-&gt;nid );
   unset($view);
   $view = views_get_view('Children');
   $view-&gt;set_display('default');  
   $view-&gt;set_arguments($args);
   $view-&gt;set_items_per_page(20);
   $view-&gt;execute();
   $newarg = array();
   for ($i=0; $i&lt;sizeof($view-&gt;result); $i++) {
      $newarg[$i] = $view-&gt;render_field('nid_1', $i);
   }
   for ($i=0; $i&lt;sizeof($newarg); $i++) {
      unset($view);
      $view = views_get_view('Children');
      $view-&gt;set_display('default');  
      $view-&gt;set_arguments($newarg[$i]);
      $view-&gt;set_items_per_page(20);
      $view-&gt;execute();
      ....
   }
}
?&gt;


The key to executing the view multiple times was for me to unset($view) when I was done with the result set.