SimpleXML XPath

xpath("//employee[@no>1 and role!='Intern']") as $employee) { // find attribute no $no = $employee->xpath("@no")[0]; // find sub elements name and role $name = $employee->xpath("name/text()")[0]; $role = $employee->xpath("role/text()")[0]; // print echo "\r\n"; echo "\r\n"; echo "\r\n"; echo "\r\n"; echo "\r\n"; } ?>
No Name Role
$no$name$role