Abstract: The finite element method is a widely accepted tool for the numerical solution of partial differential equations. Nowadays a posteriori error estimation is an expected and assessed feature in scientific computing. It is used for adaptively creating approximation spaces and to assess the accuracy of numerical solutions. The performance of the method can be improved by mesh refinement (h-refinement) or the use of higher oder ansatz spaces (p-refinement). Taking a combination of both (hp-refinement) can lead to exponentially fast convergence with respect to the number of degrees of freedom. Especially for hp-FEM there have been proposed several strategies for adaptively creating problem-dependent meshes, e.g. estimating the analyticity of the solution, solving local boundary value problems and minimize the global interpolation error can be minimized. In this talk we present a fully automatic hp-adaptive refinement strategy, which is based on the solution of local boundary value problems. We present the strategy for the Poisson and the Maxwell boundary value problem and show convergence of the algorithm. The talk is concluded by some numerical examples.