Deduplicate object metadata

API: de-duplicate metadata code for n/w/r …

The common code has been refactored into `lib/ObjectMetadata::add_metadata_to_xml_node`