protected function getTemplateSettings($strTemplateFilePath, &$strTemplate = null)
    {
        if ($strTemplate === null) {
            $strTemplate = file_get_contents($strTemplateFilePath);
        }
        $strError = 'Template\'s first line must be <template OverwriteFlag="boolean" TargetDirectory="string" DirectorySuffix="string" TargetFileName="string"/>: ' . $strTemplateFilePath;
        // Parse out the first line (which contains path and overwriting information)
        $intPosition = strpos($strTemplate, "\n");
        if ($intPosition === false) {
            throw new \Exception($strError);
        }

        $strFirstLine = trim(substr($strTemplate, 0, $intPosition));

        $objTemplateXml = null;
        // Attempt to Parse the First Line as XML
        try {
            @$objTemplateXml = new \SimpleXMLElement($strFirstLine);
        } catch (\Exception $objExc) {
        }

        if (is_null($objTemplateXml) || (!($objTemplateXml instanceof \SimpleXMLElement))) {
            throw new \Exception($strError);
        }
        $strTemplate = substr($strTemplate, $intPosition + 1);
        return $objTemplateXml;
    }