added tests for writing xml metadata