ported the rest of ElementNode