Partially crystalline structure of doped polypyrrole and polyaniline is investigated by the X-ray diffraction experiment and compared with the results from transport measurements. The increase of crystallinity along the direction of polymer chain in pyrrolehexafluorophosphate (PPy-PF6) film indicates that intrachain disorder plays a critical role in transport in the metallic regime of the metal-insulator (M-1) transition. The X-ray structure of doped polyaniline sample in the insulating regime close to the M-I transition boundary suggests that the temperature dependence of electrical resistivity is related to the geometry of aligned polymer chains in crystalline region. In the far insulating regime, no clear relation to transport data is observed in the microscopic crystalline structure possibly due to a strong disorder from large scale inhomogeneity.