What is left to notice is that you can write p(x) as a product
a U2n V2m (X2 + Y2)k ...
and that this can be expanded in the desired form (a is the leading coefficient of p, and is positive)