Error checking in XMLToLegion