Two indeces XAU and HUI formed as basket of stocks of gold mining companies, but not all just those companies which has not long term contracts for delivery, around one year not longer. And in this case, value of these indeces depend on gold prices. If you want trade gold stocks with using of XAU as underline instrument, you need take a basket of gold stocks. look structure of XAU here: goldsheetlinks.com/xau.htm
You have to check how those mining companies are dealing with their future production. If they lock away at lower prices while costs rise, not a winner even if precious metals skyrocket.