This is already in https://github.com/geopython/OWSLib/blob/master/owslib/util.py#L314