Finite elements for elasticity with microstructure and gradient elasticity