beef up xml handling functions