private void ProcessCurrentXmlDocument(XmlDocument document, HTMLParserContext parseContext)
        {
            //Start looking for include files
            foreach (XmlNode includeNode in document.SelectNodes("//include"))
            {
                foreach (XmlAttribute attribute in includeNode.Attributes)
                {
                    parseContext.addIncludeFile(attribute.Value);
                }
            }
            //Look for definition tags in all of the files and add these to the parse context, we need these to figure out what certain groups mean, might just do a text replace
            foreach (XmlNode definitions in document.SelectNodes("//definition"))
            {
                foreach (XmlNode definitionNode in definitions.ChildNodes)
                {
                    parseContext.addDefinitionNode(definitionNode);
                }
            }
            //Find style tags, these might be in a single external file or anywhere through out the HTML code
            foreach (XmlNode styles in document.SelectNodes("//style"))
            {
                //Should only be one of these and all we want is the inner xml which contain css definitions
                var stylesString = styles.InnerXml.Trim();
                string[] cssEndMark = {"}"};
                string[] stylesStrings = stylesString.Split(cssEndMark, StringSplitOptions.RemoveEmptyEntries);
                foreach (var style in stylesStrings)
                {
                    parseContext.addStyleNode(style);
                }
            }

            //Parse the body for each file with the above information and transform to final output file(s)
            //We are using an intermediate file for each first to replace the shortcut HTML

            XmlNode body_node = document.SelectSingleNode("//body");
            XmlNode importedBodyNode = parseContext.IntermediateDocument.ImportNode(body_node, true);
            foreach (XmlNode child in importedBodyNode.ChildNodes)
            {
                parseContext.IntermediateRootElement.AppendChild(child);
            }

            parseContext.IntermediateDocument.AppendChild(parseContext.IntermediateRootElement);
            parseContext.IntermediateDocument.Save(m_settings.m_rootPath + "intermediate.xml");
        }