Retrieves child-element by name and position. If no child is found,
`NULL` will be returned.

@since Symphony 2.3
@param string $name
@param integer $position
@return XMLElement
515548
public function getChildByName($name, $position)
    {
        $result = array_values($this->getChildrenByName($name));

        if (!isset($result[$position])) {
            return null;
        }

        return $result[$position];
    }
528220
public function selectChild($name) {
			// The data we want was not found:
			if (isset($this->stack[$this->index]->value[$name]) === false) {
				return false;
			}

			$this->stack[$this->index + 1] = (object)[
				'key' =>	$name,
				'value' =>	&$this->stack[$this->index]->value[$name]
			];
			$this->index++;

			return true;
		}
635579
public function getByPosition($position)
    {
        $position = (int) $position;

        if (!isset($this->parametersByPosition[$position])) {
            throw new \Exception('Parameter is not defined !');
        }

        return $this->parametersByPosition[$position];
    }
891513
public function element(string $name): ElementInterface
    {
        if (! isset($this->elements[$name])) {
            throw new ElementNotFoundException(
                sprintf('The element with name <code>%s</code> does not exists', $name)
            );
        }

        return $this->elements[$name];
    }
1174174
public function getChild(string $name): ?vfsStreamContent
    {
        $childName = $this->getRealChildName($name);
        foreach ($this->children as $child) {
            if ($child->getName() === $childName) {
                return $child;
            }

            if (!$child instanceof vfsStreamContainer) {
                continue;
            }

            if ($child->appliesTo($childName) && $child->hasChild($childName)) {
                return $child->getChild($childName);
            }
        }

        return null;
    }
118675
public function button($name, $position="BL", $attributes=array())
    {
        $attributes = array_merge(array("class"=>"btn btn-default"), $attributes);

        $this->button_container[$position][] = Form::button($name, $attributes);

        return $this;
    }
421953
public function peekTokenAt($position) {
		if ($position < count($this->tokens)) {
			return $this->tokens[$position];
		} else {
			return null;
		}
	}
546540
public function getAt($position)
    {
        if($position < $this->count() && $position < 0) {
            return null;
        }
        
        $this->first();
        
        while($position > 1) {
            $this->next();
            --$position;
        }
        
        return $this->current();
    }
54612
public function getPosition($name = 'current')
    {
        $response = $this->browser->request('GET', 'window/'.urlencode($name).'/position');
        $body = json_decode($response->getContent(), true);

        return array($body['value']['x'], $body['value']['y']);
    }
643112
public function createElement(Node $parent, $name)
    {
        foreach ($this->registry[ElementExtension::class] as $extension) {
            $node = $extension->createElement($parent, $name);
            if ($node) {
                return $node;
            }
        }

        return null;
    }
441508
public function getChild($name)
    {
        foreach ($this->childProperties as $child) {
            if ($child->getName() === $name) {
                return $child;
            }
        }

        throw new NoSuchPropertyException();
    }
146824
public function addToken($name, $position) {
        $token = new Token($name, $position);
        $this->tokens[] = $token;

        // Autoclose opened tokens
        switch (substr($name, -4)) {
            case AbstractBlockRule::OPEN:
                $this->openedTokens[] = substr($name, 0, -5);
                break;
            case AbstractBlockRule::CLOSE:
                while (count($this->openedTokens) > 0) {
                    $lastOpenToken = array_pop($this->openedTokens);
                    $this->tokens[] = new Token($lastOpenToken . AbstractBlockRule::CLOSE, $position);
                    if ($lastOpenToken == substr($name, 0, -5)) {
                        break;
                    }
                }
                break;
        }

        return $token;
    }
102808
public function link($url, $name, $position="BL", $attributes=array())
    {
        $base = str_replace(Request::path(),'',strtok(Request::fullUrl(),'?'));
        $match_url = str_replace($base, '/', strtok($url,'?'));
        if (Request::path()!= $match_url) {
            $url = Persistence::get($match_url, parse_url($url, PHP_URL_QUERY));
        }


        $attributes = array_merge(array("class"=>"btn btn-default"), $attributes);
        $this->button_container[$position][] =  HTML::link($url, $name, $attributes);
        $this->links[] = $url;

        return $this;
    }
160224
public function getChild(
        SimpleXMLElement $element,
        $name,
        array $attributes = []
    ) {
        $xpath = $name . $this->getAttributesXpath($attributes);

        $result = $element->xpath($xpath);
        if (empty($result)) {
            $node = $element->addChild($name);
            $this->setAttributes($node, $attributes);
        } else {
            $node = reset($result);
        }

        return $node;
    }
439417
public static function getChildElement(DOMElement $parent, $childName)
    {
        $listElements = $parent->getElementsByTagName($childName);
        if ($listElements->length > 0) {
            for ($i = 0; $i < $listElements->length; $i++) {
                $currentItem = $listElements->item($i);
                if ($parent->isSameNode($currentItem->parentNode)) {
                    return $currentItem;
                }
            }
        }

        return null;
    }
997999
protected function childToArray(SimpleXmlElement $xml, $name)
    {
        if (!isset($xml->{$name})) {
            return array();
        }

        return $xml->{$name}->toPhpValue('array');
    }
13686
public function GetElement($name)
    {
        $element = $this->Elements()->GetElement($name);
        if (!$element)
        {
            throw new \Exception(Trans('Core.Form.Error.ElementNotFound.Name_{0}', $name));
        }
        return $element;
    }