Add middlewares to indicate dependencies in xml.