Flameskulls have the following traits (Monster Manual, p. 135):
Eldritch Rejuvenation. A flameskull's shattered fragments reform unless they are splashed with holy water or subjected to a dispel magic or remove curse spell. If it can no longer fulfill its intended purpose, the re-formed flameskull is beholden to no one and becomes autonomous.
Rejuvenation. If the flameskull is destroyed, it regains all its hit points in 1 hour unless holy water is sprinkled on its remains or dispel magic or remove curse spell is cast on them.
If you defeat a creature like a flameskull, and wait for an hour until it rises again, then you kill it again, wait another hour, and kill it yet again... would you earn the XP each time you kill it? (Basically making an XP factory.)
Is there any rule which forbids that exploit?
Related question on turning defeated enemies into undead to defeat them again. This question differs from it because the creature is returning by its own natural ability and not a mechanic provided by an adventurer, which might affect whether it counts as “defeated” for the purpose of earning XP.