This XML logic should be explained in comments.