Looking to take a non-qual 529 withdrawal from daughters account. Is there a way to withdraw only the principal? If not, how/who is it taxed?

-Account is about 50/50 principal/earnings