// $doc = new domdoc.. $xpath = New domXpath($doc); $query = "//elemento"; $xpathQuery = $xpath->query($query); $node = $xpathQuery->item(0);