Write a Capability List to outfile or STDOUT.

def write_capability_list(self, capabilities=None,
                              outfile=None, links=None):
        """Write a Capability List to outfile or STDOUT."""
        capl = CapabilityList(ln=links)
        capl.pretty_xml = self.pretty_xml
        if (capabilities is not None):
            for name in capabilities.keys():
                capl.add_capability(name=name, uri=capabilities[name])
        if (outfile is None):
            print(capl.as_xml())
        else:
            capl.write(basename=outfile)