I have the following code: $cats = $xml->evaluate("//SCAN/IP[@value=".$ip_ip."]/VULNS[1]/CAT"); foreach ($cats as $cat) { $cat_atts = $xml->get_attributes($cat); $vuln_cat = $cat_atts["value"]; $vuln_port = $cat_atts["port"]; $vulns = $xml->evaluate("//SCAN/IP[@value=".$ip_ip."]/VULNS[1]/CAT[@value=".$vuln_cat ."]/VULN"); foreach ($vulns as $vuln) { ...................... On the first pass thru $cat I get only the $vulns for that $cat, however on the second $cat I get the $vulns for the first and second $cat as can be seen below. /SCAN[1]/IP[1]/VULNS[1]/CAT[1] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[1] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[2] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[3] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[4] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[5] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[6] /SCAN[1]/IP[1]/VULNS[1]/CAT[2] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[1] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[2] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[3] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[4] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[5] /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[6] /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[1] /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[2] /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[3] /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[4] Is this the way its supposed to work and any suggestions on how to get around this would be greatly appreciated. Thanks in advance for any help, Steve Dowell -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https:[EMAIL PROTECTED]/ _______________________________________________ Phpxmldb-phpxml-arc mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/phpxmldb-phpxml-arc