if ($node instanceof NodeOutputInterface
) { return null;
} // here, $nested means "being at the root level of a child template"
// we need to discard the wrapping "Node" for the "body" node
$nested =
$nested || Node::
class !== \
get_class($node);
foreach ($node as $k =>
$n) { if (null !==
$n && null ===
$this->
filterBodyNodes($n,
$nested)) { $node->
removeNode($k);
} } return $node;
}}