The cooling and crystallization of magma forms new igneous rock. Weathering, erosion and deposition of the material could result in the transition to sedimentary rock. Heat and pressure could then result in metamorphic rock. If this rock melts and forms magma, it could again crystallize into igneous rock.