We develop an efficient algorithm and a novel recurrence relation for computing the Debye function of carbon nanotubes. This allows the computation of the XRD profile of CNTs for arbitrary lengths in times which scales linearly with the tube length. Using the recurrence relation, we further show that the XRD peak intensities are proportional to the tube length. The slopes and intercepts of the peak intensity versus tube length plots are characteristic of the CNT type. This work will help to create a database for CNTs akin to the ICDD data for 3-D crystals. Methods are also sketched to deduce tube properties from the XRD data.