Short guide detailing how to use the new drivers included in kernel (since 5.1) for an XP-Pen tablet.
As of 5.1, this method should work for at least the XP-Pen G540 and G640 (I am using a G540 but commands given should be identical across either tablet.)
Running xinput list
should yield something similar to this:
$ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]