The main function of xylem is to transport water, and some soluble nutrients including minerals and inorganic ions, upwards from the roots to the rest of the plant. Xylem cells form long tubes that transport materials, and the mixture of water and nutrients that flows through the xylem cells is called xylem sap.