/** * Returns an array of sub elements. * * @param SimpleXMLElement XML-Object * @param boolean * * @return array Children array */ protected function getChildren(XMLObj $xmlObj, $tree = false) { $childrenArray = array(); $children = $xmlObj->children(); foreach ($children as $key => $childObj) { if ($tree) { $childrenArray[] = $this->getElementTree($key, $childObj); } else { $childrenArray[] = $childObj; } } return $childrenArray; }