Abstract function for getting specific node parent