Fix several AttributeErrors in RepoMetadata.add().
 Fix open_checksum and open_size calculation in RepoMetadata.add().

Fix the code path when the provided metadata is an instance of minidom.Document.