- simplexml_load_string: documentation ( source)
<?php
$xml=simplexml_load_string(<<<XML
<feed>
<entry>
<id>1980475</id>
<link rel="post" href="http://..."></link>
<link rel="edit" href="http://..."></link>
<link rel="alternate" href="http://..."></link>
</entry>
<entry>
<id>1980476</id>
<link rel="post" href="http://..."></link>
<link rel="edit" href="http://..."></link>
<link rel="alternate" href="http://...">
<lo> naiya </lo>
<lo> naiya </lo>
</link>
</entry>
</feed>
XML
);
echo count($xml->xpath('//link[@rel="alternate"]'));
$node = $xml->xpath('//link[@rel="alternate"]');
foreach ((string)$node->children() as $f){
echo $f;
}