public function import(\SimpleXMLElement $sx)
 {
     if (isset($sx->singlepages)) {
         foreach ($sx->singlepages->page as $p) {
             $pkg = static::getPackageObject($p['package']);
             if (isset($p['global']) && (string) $p['global'] === 'true') {
                 $spl = Single::addGlobal($p['path'], $pkg);
             } else {
                 $root = false;
                 if (isset($p['root']) && (string) $p['root'] === 'true') {
                     $root = true;
                 }
                 $siteTree = null;
                 if (isset($this->home)) {
                     $siteTree = $this->home->getSiteTreeObject();
                 } else {
                     $home = \Page::getByID(HOME_CID);
                     $siteTree = $home->getSiteTreeObject();
                 }
                 $spl = Single::createPageInTree($p['path'], $siteTree, $root, $pkg);
             }
             if (is_object($spl)) {
                 if ($p['name']) {
                     $spl->update(array('cName' => $p['name'], 'cDescription' => $p['description']));
                 }
                 if ($p['custom-path']) {
                     $spl->setCanonicalPagePath((string) $p['custom-path'], false);
                 }
             }
         }
     }
 }