I am having a problem iterating through elements in a DOMNodeList. I am trying to put a whole paragraph into a string. I can get each sentence separately using this:

```
$node = $paragraph->item(0);  //first line of the paragraph
$node = $paragraph->item(1);  //second line of the paragraph

```

But I cannot seem to loop through all of the sentences and put them into the one string. I have tried this but it didn't work:

```
for($i=0; $i<3; $i++)
{
    $node = $paragraph->item($i); 
}

```

Any ideas how I could do this?