Import xml_encode() from IRSpy rather that IRSpy::Record