job done, and payment sent. Thanks soulscratch, however someone else contacted me and finished the job first.
Think I finally got it, assuming the only namespace you use is xhtml:, <?php error_reporting( E_ALL ); $pFile = new SimpleXMLElement('sample.xml', null, true); foreach ($pFile->entry as $pChild) { echo "<p>\n"; echo "Link is: " .$pChild->link->attributes()->href . "<br />\n"; echo "Author is: " . $pChild->author->name . "<br />\n"; if (!empty($pChild->content)) { if ($pChild->content->attributes()->type == "xhtml") { $ns = 'http://www.w3.org/1999/xhtml'; $thing = $pChild->content->children( $ns )->div->asXML(); $thing = str_replace( 'xhtml:', '', $thing ); echo $thing; } echo '<br>after'; // echo "<br>Conent is: " . $pChild->content->asXML() . "<br />\n"; } elseif (!empty($pChild->summary)){ echo "Summary is: " . $pChild->summary . "<br />\n"; } else { // no conent nor summary, don't need to print } echo "</p>\n"; } Code (markup): xml I used: <thing> <entry> <title>Test entry</title> <id>http://example.org/article</id> <link href="http://example.org/article" /> <content type="xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <xhtml:div>This is a <xhtml:em>sample</xhtml:em> content. & <xhtml:img src="http://www.example.com/smiley" alt=":-)" /></xhtml:div> </content> <author> <name>John</name> </author> </entry> </thing> Code (markup): Source output: <p> Link is: http://example.org/article<br /> Author is: John<br /> <div>This is a <em>sample</em> content. & <img src="http://www.example.com/smiley" alt=":-)"/></div><br>after</p> Code (markup):