/// <summary>
        /// Converts metadata and code into raw HTML file content which can be written to disk.
        /// </summary>
        /// <param name="input">Metadata and code</param>
        /// <returns>Raw HTML file content</returns>
        public string InsertMetadata(Template input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            var formattedMetadata = _metadataFormatter.Format(input.Metadata);
            var code = string.Format(MetadataFormat, formattedMetadata, input.Code);

            return(code);
        }
        /// <summary>
        /// Converts metadata and code into raw XML file content which can be written to disk.
        /// </summary>
        /// <param name="input">Metadata and code</param>
        /// <returns>Raw XML file content</returns>
        public string InsertMetadata(Template input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            // Parse xml.
            var xmlDocument = new XmlDocument();

            xmlDocument.LoadXml(input.Code);

            // Add comment to start of document.
            var metadataString      = _metadataFormatter.Format(input.Metadata);
            var metadataCommentNode = xmlDocument.CreateComment(string.Format(MetadataFormat, metadataString));

            xmlDocument.PrependChild(metadataCommentNode);

            return(GenerateDocumentXml(xmlDocument));
        }