The architecture of IEC 61850-based general gateway with flexibly arranged bay level is proposed. A new protocol-mapping method named metadata-mapping that uses XML Schema technology to model the metadata of the protocol and protocol-mapping is also designed. The bay equipment uses the modeling files to seamlessly convert the communication protocol into IEC 61850 protocol. With the new method, the IEC 61850-based general gateway is enabled to have the characteristics of smart configuration and strong universality. Finally, an example is given of using the XML Schema for modeling the IEC 60870-5-103 protocol.