Fixed XML compatibility and debug output