@Joel_Peter
1). It’s corrupted because there is a bug in your codes, please change it as the following:
workbook.CustomXmlParts.Add(Encoding.GetEncoding("UTF-16").GetBytes(SerializeToXML(metadata)), Encoding.GetEncoding("UTF-16").GetBytes(SerializeToXML(metadata)));
Xml returned by XmlSerializer contains encoding definition :<?xml version="1.0" encoding="utf-16"?>
2). As far as I know, custom xml part works for two features: Custom UI and ContentTypeProperties.
I do not think it’s good to hide data to custom xml.
If you do not want the metadata to be viewed by the user, you can hide a worksheet with VisibilityType.VeryHidden too as codes in the previous, then hide you data to this sheet. Very hidden worksheet can not be accessed in MS Excel viewer.