public void PersonXmlWriter(ArrayList<Speaker> speakerList) {
        // String to hold date
        String tempDate = null;
        
        // Creates a folder in the documents folder to store xml file
        File dir1 = new File(database + "SpeakerFile_files");
        dir1.mkdir();


        try {
            // Creates objects needed to create DOM structure
            DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
            Element personToAdd;
            Element topicToadd;
            Element sessionToAdd;

            // Creates root element in DOM structure
            Document doc = docBuilder.newDocument();
            Element rootElement = doc.createElement("SpeakersToTopics");
            doc.appendChild(rootElement);

            // Loop to add speakers to rootElement 
            for (Speaker speaker : speakerList) {
                // staff elements
                personToAdd = doc.createElement("Person");
                personToAdd.setAttribute("name", speaker.getFirstName() + " " + speaker.getLastName());
                rootElement.appendChild(personToAdd);

                // Loop to add topics to speaker
                for (Map.Entry<String, List<Content>> topic : speaker.getTopics().entrySet()) {
                    topicToadd = doc.createElement("Topic");
                    topicToadd.setAttribute("subject", topic.getKey());
                    personToAdd.appendChild(topicToadd);

                    // loop to add session to topic
                    for (Content session : topic.getValue()) {
                        sessionToAdd = doc.createElement("Content");
                        sessionToAdd.setAttribute("date", session.getDate().toString());
                        sessionToAdd.setTextContent(session.getContent());
                        topicToadd.appendChild(sessionToAdd);

                        if (tempDate == null) {
                                tempDate = session.getDate().toString();
                            }
                    }
                }
            }

            // Creates objects need to write DOM to XML file               
            TransformerFactory transformerFactory = TransformerFactory.newInstance();
            Transformer transformer = transformerFactory.newTransformer();
            DOMSource source = new DOMSource(doc);

                // Creates stream that specifies name of file and folder to save
            // file in.
            StreamResult result = new StreamResult(new File(dir1, "Session." + tempDate + ".xml"));

            // Sets formating for XML file
            transformer.setOutputProperty(OutputKeys.INDENT, "yes");

            // Write XML file
            transformer.transform(source, result);
        } catch (ParserConfigurationException pce) {
            pce.printStackTrace();
        } catch (TransformerException tfe) {
            tfe.printStackTrace();
        }
    }