protected function getNodes( $requestUri, $depth )
    {
        $source = $requestUri;
        $nodeInfo = $this->getNodeInfo( $requestUri );

        if ( !$nodeInfo['nodeExists'] )
        {
            return array();
        }

        // No special handling for plain resources
        if ( !$nodeInfo['isCollection'] )
        {
            return array( new ezcWebdavResource( $source, $this->getAllProperties( $source ) ) );
        }

        // For zero depth just return the collection
        if ( $depth === ezcWebdavRequest::DEPTH_ZERO )
        {
            return array( new ezcWebdavCollection( $source, $this->getAllProperties( $source ) ) );
        }

        $nodes = array( new ezcWebdavCollection( $source, $this->getAllProperties( $source ) ) );
        $recurseCollections = array( $source );

        // Collect children for all collections listed in $recurseCollections.
        for ( $i = 0; $i < count( $recurseCollections ); ++$i )
        {
            $source = $recurseCollections[$i];

            // add the slash at the end of the path if it is missing
            if ( $source{strlen( $source ) - 1} !== '/' )
            {
                $source .= '/';
            }
            $children = $this->getCollectionMembers( $source, $depth );

            foreach ( $children as $child )
            {
                $nodes[] = $child;

                // Check if we should recurse deeper, and add collections to
                // processing list in this case.
                if ( $child instanceof ezcWebdavCollection
                     && $depth === ezcWebdavRequest::DEPTH_INFINITY
                     && $child->path !== $source ) // @as added for recursive DEPTH_INFINITY
                {
                    $recurseCollections[] = $child->path;
                }
            }
        }

        return $nodes;
    }