Geometrically nonlinear hierarchical finite elements via a unified formulation