code: void removeMembership(Node refUserNode, Node refTypeNode) throws Exception
     {
        refTypeNode.remove();
        if (!refUserNode.hasNodes())
        {
           refUserNode.remove();
        }
     }
docs: Remove membership record.