Maybe try this instead:
````javascript
result = obj.Body[output.$name.replace(/(?:Soap)?(?:Out(?:put)?|Response)$/, '')];
````

You may be able to replace 182-185 below with this.