Attempt to fix failures in travisci.

Network tests have recently started failing, make those skip conditions
instead. Convert SocketExceptions in Xml::build() into XmlExceptions.
This is the documented behavior so we should try to honour that.