public boolean saveWorld(File worldFile, WorldDataManager worldToSave)
    {
        try 
        {
            // THESE WILL US BUILD A DOC
            DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
            
            // FIRST MAKE THE DOCUMENT
            Document doc = docBuilder.newDocument();
            
            // THEN THE ROOT ELEMENT
            Element rootElement = doc.createElement(WORLD_REGIONS_NODE);
            doc.appendChild(rootElement);
 
            // THEN THE REGIONS LIST
            Element regionsListElement = makeElement(doc, rootElement, REGIONS_LIST_NODE, "");
            
            // AND LET'S ADD ALL THE REGIONS
            for (Region region : worldToSave.getAllRegions())
            {
                // MAKE A REGION NODE AND ADD IT TO THE LIST
                Element regionNodeElement = makeElement(doc, regionsListElement,
                        REGION_NODE, "");
                
                // NOW LET'S FILL IN THE REGION'S DATA. FIRST MAKE THE ATTRIBUTES
                doc.createAttribute(ID_ATTRIBUTE); 
                doc.createAttribute(NAME_ATTRIBUTE);
                doc.createAttribute(TYPE_ATTRIBUTE);
                doc.createAttribute(CAPITAL_ATTRIBUTE);
                regionNodeElement.setAttribute(ID_ATTRIBUTE, region.getId());
                regionNodeElement.setAttribute(NAME_ATTRIBUTE, region.getName());
                regionNodeElement.setAttribute(TYPE_ATTRIBUTE, region.getType().toString());
                if (region.hasCapital())
                {
                    regionNodeElement.setAttribute(CAPITAL_ATTRIBUTE, region.getCapital());
                }   
             }

            // AND NOW ADD ALL THE CONNECTIONS
            Element regionsMappingsElement = makeElement(doc, rootElement, REGIONS_MAPPINGS_NODE, "");
            for (Region region: worldToSave.getAllRegions())
            {
                // MAKE A REGION NODE AND ADD IT TO THE LIST
                Element regionNodeElement = makeElement(doc, regionsMappingsElement, REGION_NODE, "");
                regionNodeElement.setAttribute(ID_ATTRIBUTE, region.getId());
                
                Iterator<Region> subRegionsIt = region.getSubRegions();
                while (subRegionsIt.hasNext())
                {
                    Region subRegion = subRegionsIt.next();
                    Element subRegionNodeElement = makeElement(doc, regionNodeElement, SUB_REGION_NODE, "");
                    subRegionNodeElement.setAttribute(ID_ATTRIBUTE, subRegion.getId());
                }
            }

            // THE TRANSFORMER KNOWS HOW TO WRITE A DOC TO
            // An XML FORMATTED FILE, SO LET'S MAKE ONE
            TransformerFactory transformerFactory = TransformerFactory.newInstance();
            Transformer transformer = transformerFactory.newTransformer();
            transformer.setOutputProperty(OutputKeys.INDENT, YES_VALUE);
            transformer.setOutputProperty(XML_INDENT_PROPERTY, XML_INDENT_VALUE);
            DOMSource source = new DOMSource(doc);
            StreamResult result = new StreamResult(worldFile);
            
            // SAVE THE POSE TO AN XML FILE
            transformer.transform(source, result);    
            
            return true;
        }
        catch(TransformerException | ParserConfigurationException | DOMException | HeadlessException ex)
        {
            return false;
        }    
    }