If you obtain the type specifier from the url filename, then it can be a bit more dynamic for you.
You don't even have to change any xml for that. In order to work, the streamformat needs to be set after the streamurl has been.
So if it's "3u8" then you have your code change it to m3u8, and if there are parameters, do a string comparison for a ? since that's the first character for any further parameters.
Or, like you said, just change the xml file it parses - but what if you don't have access or permissions to change the xml file, then how do you do it?