Parse SAML Response XML String using PHP

     

I have


an XML in string format and my goal is to be able to parse it and access it in my application.


$string = 'googlegoogle7UEwFm4rmsYhCW+Py+2wsebt4mY=KeoIv21bQ5SBKWBY8lewzdCSw/dWUsgwtkUNqBm9dU9kWNQTkxk7pCgkDTBH19naLyvvYMAjBlHxrdqyheYA3McJz7BJSkl7sM/VeIqjaU02LUMVlHpQ4mNwfZDzRqQy5N4wVZyCD8uwEKtG1koSs8xDUHSG2T+YT9Tc9gbUDkr0SzzMm9xG9fRU9+Sd+2WT/odCYtwSF2kvdm/zlnzBMxC6U+wQlD6J/HSZB5mynuFnjV/tJFvc0365bBTV+zp6cUBXqWXux/8Jhf5WmwiEUXlWuI40B07jAvtNu9efWg7fg1os5qAeifxYoNRWfNnXURtOhxQKIvOhQ17deqhHsw==MIIFEDCCA/igAwIBAgISESGPUFv6nrdz9MQhPdUHogGNMA0GCSqGSIb3DQEBCwUAMGAxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTYwNAYDVQQDEy1HbG9iYWxTaWduIERvbWFpbiBWYWxpZGF0aW9uIENBIC0gU0hBMjU2IC0gRzIwHhcNMTUwNDA5MTUzODMyWhcNMTgwNjI1MDY0MjQ4WjBPMSEwHwYDVQQLExhEb21haW4gQ29udHJvbCBWYWxpZGF0ZWQxKjAoBgNVBAMTIXdsc09zYk1uZ2RWaXAudWF0LmNvcnAudGVsZW5ldC5iZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMDItqITYRdhcWo8fmyo0ZUQwLfCwh7g8BwRA+EOlnMAKqtW0n/grBE4Zu8kAVT5ZIQ9AeU7I2MGANzK610jSfQmkGDISR1wYpCnk6oXq5hPpYGnRfFkTEo8wUpgPWsvrMTtEoLxEGuMee6+wNQUzl7PGLJFvL/pOPgOyci7J8vSgxePwDYTEBDktX9kgFPYqyUqPSrOxh72Zk+PVchyUX3sLR+gedq1VCiHIgpAEK23q/NVfQ0jDSiHZ2f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