use utility function

depends on https://github.com/dimagi/casexml/pull/92/