- Sort xrefs by section, and then alphabetically. - Add missing commas between xref items. - Remove commas from the last xref entry. - Remove duplicate entries.