public function processAttributes(&$reader, &$tree)
    {
        $name = $reader->name;

        $node = new \stdClass();

        $node->attr = new \stdClass();

        while ($reader->moveToNextAttribute()) {
            $node->attr->$name = $reader->value;
        }

        if (isset($tree->$name) && is_a($tree->$name, 'ArrayObject')) {
            $lastKey = $tree->$name->count() - 1;

            $node->value = $tree->$name->offsetGet($lastKey);
            $tree->$name->offsetSet($lastKey, $node);
        } else {
            $node->value = isset($tree->$name) ? $tree->$name : '';

            $tree->$name = $node;
        }
    }