boolean containsChild(BaseType node, List<BaseType> list) {
   String nodename = node.getLongName();
   for (BaseType child : list) {
     String childname = child.getLongName();
     if (childname.startsWith(nodename)) return true;
   }
   return false;
 }
 BaseType containsParent(BaseType node, List<BaseType> list) {
   String nodename = node.getLongName();
   for (BaseType parent : list) {
     String parentname = parent.getLongName();
     if (nodename.startsWith(parentname)) return parent;
   }
   return null;
 }