PHP's SimpleXMLElement analog for Node.js
===

The best XML reading and writing API I've ever used is PHP's [SimpleXMLElement](http://php.net/manual/en/class.simplexmlelement.php). For example, to create a DOM of the following XML text:

    <root>
        <foo>
            <bar baz="goo">
            </bar>
        </foo>
    </root>

in PHP one would just write:

    $root = new SimpleXMLElement('<root/>');
    $root->foo->bar['baz'] = 'goo';

I heard people calling it a "builder pattern". Not quite sure if that's appropriate. Anyway, is there any API under Node.js having a comparable ease of use?