The Moon has a constant source of solar energy. If there is hydrogen there, you have water and oxygen. Transportation costs might be costly.
Scientific note. Hydrogen does not contain water or oxygen, duh. We still nee that.