if ( $node1->isEqual( $node2 ) ) { print "The two nodes are the same!\n"; }