<?php
$string = <<<XML
<a>
<b>
<c>text</c>
<c>stuff</c>
</b>
<d>
<c>code</c>
</d>
</a>
XML;
$xml = new SimpleXMLElement($string);
echo $xml->asXML();
$result = $xml->xpath('/a/b/c');
while(list( ,$node) = each($result))
{
echo $node->asXML($result);
}
need this output:
<c>text</c>
<c>stuff</c>
<>code</c>