Move some methods to Code2Xml.