Upgrade code to use erim_xml