The influence of dark matter inhomogeneities on the angular size-redshift test is investigated for a large class of flat cosmological models driven by dark energy plus a cold dark matter component (XCDM). The results are presented in two steps. First, the mass inhomogeneities are modeled by a generalized Zeldovich-Kantowski-Dyer-Roeder (ZKDR) distance which is characterized by a smoothness parameter α(z) and a power index γ, and, second, we provide a statistical analysis to angular size data for a large sample of milliarcsecond compact radio sources. As a general result, we have found that the α parameter is totally unconstrained by this sample of angular diameter data. 95.36.+x; 95.35.+d