util,xml: move useful functions to libwicked

Nothing major, just something a little re-organization of some useful utility functions I noticed when looking at routing tables earlier.

Feel free to close if not needed.