private static void outputX3D(X3D root, Shape shape, ElevationGrid elevation)
        {
            X3DSceneGraphXMLSerializer serializer;
            string xml;

            shape.Children.Add(elevation);

            // Build XML from all the SceneGraphNodes
            serializer = new X3DSceneGraphXMLSerializer(root);
            xml        = serializer.Serialize();

            Console.WriteLine("\nDone.");

            //Console.WriteLine("\n~~~ X3D Generated Below ~~~\n");
            //Console.WriteLine(xml);

            // Save output XML to x3d file
            string fileX3d, filePng;

            fileX3d = newIndexedFile(X3dGenOutputFileLocation);
            filePng = newIndexedFile(PngGenOutputFileLocation);

            File.WriteAllText(fileX3d, xml);
            largePerlinImage.Save(filePng);

            Console.WriteLine("See Auto Generated X3D file in {0}", fileX3d);
            Console.WriteLine("See Auto Generated perlin noise texture in {0}", filePng);
            Console.ReadLine();
        }
        /// <summary>
        /// Compiles a Scene Graph into XML.
        /// </summary>
        public static string CompileXML(SceneGraph graph)
        {
            X3DSceneGraphXMLSerializer serializer;

            serializer = new X3DSceneGraphXMLSerializer(graph.GetRoot());

            return(serializer.Serialize());
        }