XML editing and processing for metadata updates using Python