То, что вы делаете там, заменяет $ root_text на $ doc-> createTextNode ($ i) в каждом цикле.
Что вы можете сделать, это сделать $ root_text массивом.
<?php
$doc = new DOMDocument('1.0', 'iso-8859-1');
$root = $doc->createElement('test');
$doc->appendChild($root);
$root_text = array(); //always initialize arrays
for($i = 1; $i <= 10; $i++) {
$root_text[] = $doc->createTextNode($i);
}
//this will output the contents of $root_text so you can examine it
print_r($root_text);
$root->appendChild($root_text);
print $doc->saveXML();
?>