public void removeNodes(final List<PackagingElementNode<?>> nodes) {
   Set<PackagingElement<?>> parents = new HashSet<PackagingElement<?>>();
   for (PackagingElementNode<?> node : nodes) {
     final List<? extends PackagingElement<?>> toDelete = node.getPackagingElements();
     for (PackagingElement<?> element : toDelete) {
       final Collection<PackagingNodeSource> nodeSources = node.getNodeSource(element);
       if (nodeSources.isEmpty()) {
         final CompositePackagingElement<?> parent = node.getParentElement(element);
         if (parent != null) {
           parents.add(parent);
           parent.removeChild(element);
         }
       } else {
         Collection<PackagingNodeSource> rootSources = getRootNodeSources(nodeSources);
         for (PackagingNodeSource source : rootSources) {
           parents.add(source.getSourceParentElement());
           source.getSourceParentElement().removeChild(source.getSourceElement());
         }
       }
     }
   }
   final List<PackagingElementNode<?>> parentNodes = myTree.findNodes(parents);
   for (PackagingElementNode<?> parentNode : parentNodes) {
     myTree.addSubtreeToUpdate(parentNode);
   }
 }
 public boolean checkCanModifyChildren(
     @NotNull PackagingElement<?> parentElement,
     @NotNull PackagingElementNode<?> parentNode,
     @NotNull Collection<? extends PackagingElementNode<?>> children) {
   final List<PackagingNodeSource> sources =
       new ArrayList<PackagingNodeSource>(parentNode.getNodeSource(parentElement));
   for (PackagingElementNode<?> child : children) {
     sources.addAll(child.getNodeSources());
   }
   return checkCanModify(sources);
 }
 public boolean checkCanModify(
     @NotNull PackagingElement<?> element, @NotNull PackagingElementNode<?> node) {
   return checkCanModify(node.getNodeSource(element));
 }