Synthesis of uniform rare earth fluoride (NaMF4) nanotubes by in situ ion exchange from their hydroxide [M(OH)3] parents.