Many posibilities! What is the max current capability of your 18Vdc supply and how much current output do you require? Tell us more about what you intend using the power supply for.
The only alteration I would recommend to Beck's suggested solution would be to use an LDO (low drop-out) linear voltage regulator such as the LM1117-ADJ in place of the LM317 linear voltage regulator that he recommended. The datasheet link provided also has some good application information in it that will help you get aquainted with the way to connect it up to your 18 V dc source. Once you open the link, you will need to scroll down a page or two since the first page appears to be blank.
The older generation of linear regulators required a couple of volts between the input voltage and the output voltage which limited how close the output voltage could be adjusted to the input voltage.
The LDO voltage regulators requires as low as 1 volt and so for 18 volts, the output could be adjusted very close to 17 volts.