function generateUpdateChildren( $paexToUpdate = array() )
    {
        eZDebug::writeDebug( 'Start', __METHOD__ );

        if ( !$this->attribute( 'updatechildren' ) )
        {
            eZDebug::writeDebug( 'UpdateChildren flag disabled. Nothing to do.', __METHOD__ );
        }
        else
        {
            $newPasswordvalidationregexp = $this->attribute( 'passwordvalidationregexp' );
            $newPasswordlifetime = $this->attribute( 'passwordlifetime' );
            $newExpirationnotification = $this->attribute( 'expirationnotification' );

            // Fetch the main node that belongs to the current paex
            $mainNodeID = eZContentObjectTreeNode::findMainNode( $this->attribute( 'contentobject_id' ) );
            eZDebug::writeDebug( 'Going to update subtree starting at node ' . $mainNodeID . '.', __METHOD__ );

            // Fetch the full subtree array to update
            $fullSubtree = eZContentObjectTreeNode::subTreeByNodeID( array( "MainNodeOnly" => false,
                                                                            "AsObject" => false ),
                                                                    $mainNodeID );

            foreach ( $fullSubtree as $node )
            {
                // Fetch the paex for each node
                $addPaexToUpdate = eZPaEx::fetch( $node["contentobject_id"] );
                // If the paex is not marked to updatechildren, update the paex object
                if ( $addPaexToUpdate instanceof eZPaEx  &&
                     $addPaexToUpdate->attribute( 'updatechildren' ) != 1 )
                {
                    $addPaexToUpdate->setAttribute('passwordvalidationregexp', $newPasswordvalidationregexp );
                    $addPaexToUpdate->setAttribute('passwordlifetime', $newPasswordlifetime );
                    $addPaexToUpdate->setAttribute('expirationnotification', $newExpirationnotification );
                    $paexToUpdate[$node["contentobject_id"]] = $addPaexToUpdate;
                }
                else
                {
                    eZDebug::writeDebug( 'Skipping object ' . $add_paex_to_update['contentobject_id'] , __METHOD__ );
                }
            }
        }
        eZDebug::writeDebug( 'End', __METHOD__ );

        return $paexToUpdate;
    }