Refactoring: making sosCallback parse the xml response document more robustly