Move code to make casexml tests happy