Index: classes/phing/UnknownElement.php
===================================================================
--- classes/phing/UnknownElement.php	(revision 193)
+++ classes/phing/UnknownElement.php	(working copy)
@@ -130,7 +130,8 @@
                 $realChild = $this->makeTask($child, $childWrapper, false);
                 $parent->addTask($realChild);
             } else {
-                $realChild = $ih->createElement($this->project, $parent, $child->getTag());
+                $project = is_null($this->project) ? $parent->project : $this->project;
+                $realChild = $ih->createElement($project, $parent, $child->getTag());
             }
 
             $childWrapper->setProxy($realChild);
@@ -138,7 +139,9 @@
                 $realChild->setRuntimeConfigurableWrapper($childWrapper);
             }
 
-            $child->handleChildren($realChild, $childWrapper);
+            if ($realChild instanceof ProjectComponent) {
+                $child->handleChildren($realChild, $childWrapper);
+            }
             if ($realChild instanceof Task) {
                 $realChild->maybeConfigure();
             }

