public function objectToDom($obj)
    {
        $doc = new DomDocument('1.0', 'utf-8');

        foreach ($obj as $k => &$v) {
            $node = $this->objectToDomElement($v, $doc->createElement($k), $doc);
            break;
        }

        $doc->appendChild($node);

        return $doc;
    }