+
+ # get hardware types
+ hardware_type_elems = node_elem.xpath('./default:hardware_type | ./hardware_type')
+ node['hardware_types'] = [hw_type.get_instance(HardwareType) for hw_type in hardware_type_elems]
+
+ # get location
+ location_elems = node_elem.xpath('./default:location | ./location')
+ locations = [location_elem.get_instance(Location) for location_elem in location_elems]
+ if len(locations) > 0:
+ node['location'] = locations[0]
+
+ # get granularity
+ granularity_elems = node_elem.xpath('./default:granularity | ./granularity')
+ if len(granularity_elems) > 0:
+ node['granularity'] = granularity_elems[0].get_instance(Granularity)
+
+ # get interfaces
+ iface_elems = node_elem.xpath('./default:interface | ./interface')
+ node['interfaces'] = [iface_elem.get_instance(Interface) for iface_elem in iface_elems]