original_string: protected function _getNode($tag, $parent, $name='')
      {
          $found = false;
          foreach ($parent->xpath($tag) as $_node) {
              if ($_node['name'] == $name) {
                  $node = $_node;
                  $found = true;
                  break;
              }
          }
          if (!$found) {
              $node = $parent->addChild($tag);
              if ($name) {
                  $node->addAttribute('name', $name);
              }
          }
          return $node;
      }
code: protected function _getNode($tag, $parent, $name='')
      {
          $found = false;
          foreach ($parent->xpath($tag) as $_node) {
              if ($_node['name'] == $name) {
                  $node = $_node;
                  $found = true;
                  break;
              }
          }
          if (!$found) {
              $node = $parent->addChild($tag);
              if ($name) {
                  $node->addAttribute('name', $name);
              }
          }
          return $node;
      }
code_tokens: protected function _getNode ( $ tag , $ parent , $ name = '' ) { $ found = false ; foreach ( $ parent -> xpath ( $ tag ) as $ _node ) { if ( $ _node [ 'name' ] == $ name ) { $ node = $ _node ; $ found = true ; break ; } } if ( ! $ found ) { $ node = $ parent -> addChild ( $ tag ) ; if ( $ name ) { $ node -> addAttribute ( 'name' , $ name ) ; } } return $ node ; }
docstring: Retrieve SimpleXMLElement node by xpath. If it absent, create new.
  For comparing nodes method uses attribute "name" in each nodes.
  If attribute "name" is same for both nodes, nodes are same.
  
  @param string $tag
  @param SimpleXMLElement $parent
  @param string $name
  @return SimpleXMLElement
docstring_tokens: Retrieve SimpleXMLElement node by xpath . If it absent create new . For comparing nodes method uses attribute name in each nodes . If attribute name is same for both nodes nodes are same .