ornek.xml here :

```
<?xml version="1.0" encoding="UTF-8"?>
<library>
    <book onay="e" katid="31" dil="tr">
        <kitapadi>Dear Lovely</kitapadi>
        <yazar>Author 1234</yazar>
        <isbn>1234513</isbn>
         </book>
         <book onay="e" katid="32" dil="en">
        <kitapadi>Love and Hate</kitapadi>
        <yazar>Author 345</yazar>
        <isbn>1234513</isbn>
         </book>
</library>

```

PHP Code:

```
$xml = simplexml_load_file('veri/ornek.xml');
$search= '34';
$result = $xml->xpath('//yazar[contains(.,"'.$search.'")]');
foreach($result as $tt){
    echo $tt;
    }

```

If I use this, I can get the `yazar` attributes. But I want get another attributes
example:

$search = 34 where match yazar 34 giving this block in kitapadi,isbn,yazar