getElementForNode handles both text and element nodes