protected function addSubpackageToPackage($packageName, $subpackageName)
    {
        $package = $this->getPackageElement($packageName);
        $subpackage = $this->getSubpackageElement($subpackageName);

        if ($package === null) {
            $package = $this->doc->createElement('package');
            $package->setAttribute('name', $packageName);
            $this->doc->documentElement->appendChild($package);
        }

        if ($subpackage === null) {
            $subpackage = $this->doc->createElement('subpackage');
            $subpackage->setAttribute('name', $subpackageName);
        }

        $package->appendChild($subpackage);
    }