// Load menu XML
function loadMenuXML()
{
   %pXml = new SimXMLDocument();
   // Load and parse XML file.
   if(!%pXml.loadFile("./scriptsAndAssets/data/ui/menuText.xml"))
   {
      echo("Failed to load menuText.xml!");
      return;
   }
   
   // Push the first child element named "menutext" onto the XML document stack.
   if(!%pXml.pushFirstChildElement("menutext"))
   {
      echo("Failed to load menutext tag.");
      return;
   }
   return %pXml;
}

/*
// -----------------------------------------------------------------------------
// Write XML level to file.
// -----------------------------------------------------------------------------
function writeXmlLevel()
{
   // Create a new XML document.
   %pXml = new SimXMLDocument();
   %pXml.addHeader();
   %pXml.pushNewElement("invadersgame");
   %pXml.pushNewElement("level");
   
   // Create alien 0.
   %pXml.pushNewElement("alien");
   // Set attribute of top stack element.
   %pXml.setAttribute("xpos", 0);
   %pXml.setAttribute("ypos", 100);
   %pXml.setAttribute("color", "red");
   %pXml.setAttribute("points", "10");
   
   // Create alien 1.
   %pXml.addNewElement("alien");
   %pXml.setAttribute("xpos", 100);
   %pXml.setAttribute("ypos", 100);
   %pXml.setAttribute("color", "green");
   %pXml.setAttribute("points", "10");
   
   // Create alien 2.
   %pXml.addNewElement("alien");
   %pXml.setAttribute("xpos", 200);
   %pXml.setAttribute("ypos", 100);
   %pXml.setAttribute("color", "blue");
   %pXml.setAttribute("points", "10");
   
   // Load and parse XML file.
   if(!%pXml.saveFile("level_2.xml"))
   {
      echo("Failed to save level.xml!");
      return;
   }
   %pXml.delete();
}
*/