protected function xml($key = null, $default = null)
    {
        if (empty($this->contentAsArray)) {
            $content = $this->getContent();
            $data = DataFormatter::xmlToArray($content);

            if (!empty($data)) {
                if ((1 === count($data)) && !array_key_exists(ResourcesWrapper::getWrapper(), $data)) {
                    // All XML comes wrapped in a single wrapper, if not resource wrapper, remove it
                    $data = reset($data);
                }

                $this->contentAsArray = $data;
            }
        }

        if (null === $key) {
            return $this->contentAsArray;
        } else {
            return array_get($this->contentAsArray, $key, $default);
        }
    }