I believe you could reuse the `xwalk.utils` that @poussa added recently.