public int detachChildNamed(String childName) {
        if (childName == null) {
            throw new IllegalArgumentException("childName cannot be null");
        }

        for (int x = 0, max = children.size(); x < max; x++) {
            Spatial child = children.get(x);
            if (childName.equals(child.getName())) {
                detachChildAt(x);
                return x;
            }
        }
        return -1;
    }
<code>detachChild</code> removes a given child from the node's list.
This child will no longer be maintained. Only the first child with a
matching name is removed.

@param childName
           the child to remove (not null)
@return the index the child was at. -1 if the child was not in the list.
jme3-core/src/main/java/com/jme3/scene/Node.java