Handle root element and nodes differently.