src/Xml/NodeStrategyCollation.php
protected function processNode( Node $node, \XMLReader $xmlReader )
    {
        $node = parent::processNode( $node, $xmlReader );
        $children = [ ];

        if( !$xmlReader->isEmptyElement )
        {
            $scanner = new NodeStrategyTraversal();
            $scanner->addNodeHandler( '*', new self( function ( $node ) use ( &$children )
            {
                $children[] = $node;
            } ) );
            $scanner->parse( $xmlReader, $this->startDepth );
        }

        $node->children = $children;

        return $node;
    }
protected function processNode( Node $node, \XMLReader $xmlReader )
    {
        $node = parent::processNode( $node, $xmlReader );
        $children = [ ];

        if( !$xmlReader->isEmptyElement )
        {
            $scanner = new NodeStrategyTraversal();
            $scanner->addNodeHandler( '*', new self( function ( $node ) use ( &$children )
            {
                $children[] = $node;
            } ) );
            $scanner->parse( $xmlReader, $this->startDepth );
        }

        $node->children = $children;

        return $node;
    }
protected function processNode ( Node $ node , \ XMLReader $ xmlReader ) { $ node = parent :: processNode ( $ node , $ xmlReader ) ; $ children = [ ] ; if ( ! $ xmlReader -> isEmptyElement ) { $ scanner = new NodeStrategyTraversal ( ) ; $ scanner -> addNodeHandler ( '*' , new self ( function ( $ node ) use ( & $ children ) { $ children [ ] = $ node ; } ) ) ; $ scanner -> parse ( $ xmlReader , $ this -> startDepth ) ; } $ node -> children = $ children ; return $ node ; }
The collation strategy should to collate all child nodes before callback

@param Node       $node
@param \XMLReader $xmlReader

@return Node The node with children collated will be passed to the callback
The collation strategy should to collate all child nodes before callback