これは私の構造です:
<Users>
<User>
<username>admin</username>
<server>10.xx.xx.xx</server>
<image>images/pic.png</image>
</User>
<User>
<username>bob</username>
<server>10.xx.xx.xx</server>
<image>images/pic2.png</image>
</User>
</Users>
これで、検索している特定のユーザー名を持つノードからサーバー値を取得するこのコードができました。
$query = '//Users/User/username[. = "'.$_SESSION['SESS_FIRST_NAME'].'"]';
$entries = $xpath->query($query);
foreach ($entries as $entry) {
//Getting the "server" node value
$server=$entry->nextSibling->nextSibling->nodeValue;
//I wanted to have one more variable here which will save me the image string in the global php variable
$images=$entry->nextSibling->nextSibling->nextSibling->nodeValue; //this is giving me a server value instead of image value
}