/**
  * Required by the Removable interface.
  */
 public function remove(LoggerInterface $logger)
 {
     $hasRemovableElements = $this->configuration->get('element-blacklist') != '';
     $hasRemovableTypes = $this->configuration->get('type-blacklist') != '';
     foreach ($this->children as $child) {
         // Check types.
         if ($hasRemovableTypes && !$this->configuration->isAllowedType($child->getType())) {
             $logger->debug('Removing ' . $child . ' on type blacklist.');
             $this->removeChild($child);
             continue;
         }
         // Check elements.
         if ($hasRemovableElements && $child instanceof Element && !$this->configuration->isAllowedElement($child->getName())) {
             $logger->debug('Removing ' . $child . ' on element blacklist.');
             $this->removeChild($child);
             continue;
         }
         // Check children.
         if ($child instanceof Removable) {
             $child->remove($logger);
         }
     }
 }