for (Object nd : nodes) {
BaseTreeModel btm = ((BaseTreeModel) nd);
Object model = btm.getProperties().get("model");
if (model != null && model instanceof TreeNode) {
TreeNode node = (TreeNode) model;
XObject wrappedXObj = browserModel.getWrappedXObject(node);
if (wrappedXObj instanceof XFolderElement
|| wrappedXObj instanceof XStaticFolder) {
elements.add(wrappedXObj);
node.setParent(newParent);
}