Channeling of X-rays in capillary systems. II. Quantum-wave approach