valid_nodes = valid_rspec.getDictsByTagName('NodeSpec')
valid_hostnames = [node['name'] for node in valid_nodes]
rspec_object = RSpec(xml=rspec)
rspec_object.filter(tagname='NodeSpec', attribute='name', whitelist=valid_hostnames)
rspec = rspec_object.toxml()
valid_nodes = valid_rspec.getDictsByTagName('NodeSpec')
valid_hostnames = [node['name'] for node in valid_nodes]
rspec_object = RSpec(xml=rspec)
rspec_object.filter(tagname='NodeSpec', attribute='name', whitelist=valid_hostnames)
rspec = rspec_object.toxml()