code: public function getNodeByName($strXpath, $strName)
      {
          $varResult = $this->xpath($strXpath . "[@name='" . $strName . "']");
  
          if ($varResult !== false) {
              // Get first element
              return reset($varResult);
          } else {
              return false;
          }
      }
docs: Get a node by attribute name and location in xpath
  
  @param string $strXpath
  @param string $strName
  @return static[] if node not found, otherwise the element