I have a XML file like the following:
&
All you need to do is just create DOMDocument object, load your xml, create DOMXpath object for your document and evaluate xpath expression:
$xml = file_get_contents( "https://crm.zoho.com/crm/private/xml/SalesOrders/getRecords?authtoken=XXX&scope=crmapi" );
$doc = new DOMDocument();
$doc->loadXML( $xml );
$xpath = new DOMXPath( $doc );
$items = $xpath->evaluate( '//FL[@val="Sales Order Owner"]' );
for ( $i = 0; $i < $items->length; $i++ ) {
echo $items->item( $i )->textContent . '
';
}
It will output:
Adithya Buddhavarapu
Adithya Buddhavarapu
Adithya Buddhavarapu
Adithya Buddhavarapu