 This paper focuses on optimizing the cost of a passive wavelength division multiplexing, WDM, optical network used as a transport network for carrying the X-Hall packet traffic between a set of remote radio sites and a central hub in a 5G radio access network, RAN. The approach is referred to as flexO. The paper formulates the X-Hall network planning problem consisting in the joint provisioning of transmission paths, TPs, between the remote sites and the hub with optimized selection and placement of optical add drop multiplexers, OADMs, on the paths and proper selection of multiplexers at the ends of the TPs. The problem formulation takes into account the optical power budget that limits the maximum transmission distance in a function of the amount and type of optical devices installed on the TPs. Numerical experiments were conducted in three mesh networks of different sizes to evaluate the cost savings from the flexible, optimized use of OADMs. The result showed that the cost savings of up to between 35 and 45% could be achieved if the selection of OADMs was optimized compared to the networks in which either single type O. This article was offered by Miroslav Klinkowski and Merit Jaworski. We are article.tv, links in the description below.