X9C103 10k digital potentiometer with LM317 0 - 20 V DC voltage source
Maximum voltage on the digital pot resistive elements is +5V, as specified in the X9C103 datasheet.
There are other digital pots which can deal with higher voltages, but also keep in mind the minimum load current on the LM317, which may be too much for a digital pot if you try to use the resistive divider for that purpose.
Edit:
One way to do something similar to what you are asking for is this:

The LM358 amplifies the voltage from the digital pot by a factor of 5. The output voltage is thus \$\alpha \cdot 25V + 1.25V\$ where \$0 \le\alpha\le 1 \$ is the digital pot setting. The minimum setting will be somewhere around 2V.
R4/U4/Q1/R1 form a simple 10mA (roughly) constant current sink to provide minimum load on the regulator down to about 2V out.
You may want to adjust the values to get exactly what you are looking for. In this case a pot setting of 0.35 yields an op-amp output of 8.75V and therefore an output voltage of 10V. The digital pot is being used as a voltage divider rather than a rheostat, which is what it does best.
Note a slightly subtle difference between the two circuits. In the case of using a digital pot directly with the LM317 the bandgap reference within the LM317 is what determines the output voltage (modulo the resistor ratios etc.), however in the above circuit, most of the output voltage is contributed by the 5V, so it would be important to have that relatively stable and accurate (and perhaps use a separate reference or regulator). You could use a TL431 and a couple of resistors, for example.