Friedel Transition in Layered Superconductors.