private function _insert(Horde_Pear_Package_Xml_Element_Directory $parent, DOMNode $point = null)
{
if ($point === null) {
$point = $parent->getDirectoryNode()->lastChild;
} else {
if ($point->previousSibling) {
$ws = trim($point->previousSibling->textContent);
if (empty($ws)) {
$point = $point->previousSibling;
}
}
}
$dir = $this->_xml->insert(array("\n " . str_repeat(" ", $this->_level), 'dir' => array('name' => $this->_name), ' ', $this->_xml->createComment(' ' . $this->_path . ' ')), $point);
$this->_xml->append("\n" . str_repeat(' ', $this->_level + 1), $dir);
$this->setDirectoryNode($dir);
}