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 model). 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 $alpha(z)$ and a power index $gamma$, 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 $alpha$ parameter is totally unconstrained by this sample of angular diameter data.