Index: kernel/classes/ezcontentobjecttreenode.php
===================================================================
--- kernel/classes/ezcontentobjecttreenode.php	(revision 22197)
+++ kernel/classes/ezcontentobjecttreenode.php	(working copy)
@@ -1269,10 +1269,10 @@
     /*!
         \a static
     */
-    static function createNotEqParentSQLString( $nodeID, $depth, $depthOperator )
+    static function createNotEqParentSQLString( $nodeID, $depth = false, $depthOperator = 'le' )
     {
         $notEqParentString  = '';
-        if( !$depth || !$depthOperator || $depthOperator != 'eq' )
+        if( !$depth || $depthOperator == 'le' || $depthOperator == 'lt' )
         {
             $notEqParentString  = "ezcontentobject_tree.node_id != $nodeID AND";
         }
@@ -1283,7 +1283,7 @@
     /*!
         \a static
     */
-    static function createPathConditionSQLString( $nodePath, $nodeDepth, $depth, $depthOperator )
+    static function createPathConditionSQLString( $nodePath, $nodeDepth, $depth = false, $depthOperator = 'le' )
     {
         $pathCondition  = '';
         $depthCondition = '';
@@ -1326,8 +1326,19 @@
     /*!
         \a static
     */
-    static function createPathConditionAndNotEqParentSQLStrings( &$outPathConditionStr, &$outNotEqParentStr, $nodeID, $depth, $depthOperator )
+    static function createPathConditionAndNotEqParentSQLStrings( &$outPathConditionStr, &$outNotEqParentStr, $nodeID, $depth = false, $depthOperator = 'le' )
     {
+        if ( !$depthOperator )
+        {
+            $depthOperator = 'le';
+        }
+
+        // check if we are only fetching children
+        // - depth (lower than or) eqaul to 1
+        // - depth lower than 2 = depth equal to 1
+        $onlyChildren = ( $depth === 1 && ( $depthOperator === 'le' || $depthOperator === 'eq'  ) ) ||
+                        ( $depth === 2 && $depthOperator === 'lt' );
+
         if ( is_array( $nodeID ) && count( $nodeID ) == 1 )
         {
             $nodeID = $nodeID[0];
@@ -1338,7 +1349,7 @@
             $outNotEqParentStr = '';
 
             // a parent_node_id condition suffits when only fetching children
-            if ( $depth === 1 && ( $depthOperator === 'eq' || $depthOperator === 'le' ) )
+            if ( $onlyChildren )
             {
                 $db = eZDB::instance();
                 $outPathConditionStr = $db->generateSQLINStatement( $nodeID, 'ezcontentobject_tree.parent_node_id', false, true, 'int' ) . ' and';
@@ -1387,7 +1398,8 @@
                         $depthCond = ' and ezcontentobject_tree.depth '. $sqlDepthOperator . ' ' . $nodeDepth . ' ';
                     }
 
-                    $notEqParentStr          = " and ezcontentobject_tree.node_id != $nodeID ";
+                    $requireNotEqParentStr      = !$depth || $depthOperator == 'le' || $depthOperator == 'lt';
+                    $notEqParentStr             = $requireNotEqParentStr ? " and ezcontentobject_tree.node_id != $nodeID " : '';
                     $sqlPartForOneNodeList[]    = " ( ezcontentobject_tree.path_string like '$nodePath%'   $depthCond $notEqParentStr ) ";
                 }
                 $outPathConditionStr = implode( ' or ', $sqlPartForOneNodeList );
@@ -1402,7 +1414,7 @@
             }
 
             // a parent_node_id condition suffits when only fetching children
-            if ( $depth === 1 && ( $depthOperator === 'eq' || $depthOperator === 'le' ) )
+            if ( $onlyChildren )
             {
                 $outNotEqParentStr = '';
                 $outPathConditionStr = 'ezcontentobject_tree.parent_node_id = ' . (int) $nodeID . ' and';
