Would you ever support more than these 2 types of responses? If so, might consider an approach like:

```
for response_type in ['Response', 'LogoutResponse']:
  response = dom.getElementsByTagNameNS('urn:oasis:names:tc:SAML:2.0:protocol', response_type)
  break if response.length > 0
throw new Error("Expected 1 Response; found #{response.length}") unless response.length is 1
```