In XFCE you can change the screen DPI in the Font tab in the Appearance dialog, which will instantly take effect. If you want to script the change, e.g. when upon connection with a docking station, you can use the following command:

xfconf-query -c xsettings -p /Xft/DPI -s <NEW_DPI>

To display the current DPI, you can just omit the -s <NEW_DPI> part.