anchor.diff:      });
       test('namespace binding', () {
         var uri = 'http://www.w3.org/2001/XMLSchema';
  -      var builder = new XmlBuilder(optimizeNamespaces: false);
  +      var builder = new XmlBuilder();
         builder.element('schema', nest: () {
           builder.namespace(uri, 'xsd');
           builder.attribute('lang', 'en', namespace: uri);
  
positive.code:       assertTreeInvariants(xml);
        var actual = xml.toString();
        var expected =
        '<schema xmlns="http://www.w3.org/2001/XMLSchema" lang="en">'
        '<element />'
        '</schema>';
        expect(actual, expected);
      });
      test('default namespace binding optimized', () {
        var uri = 'http://www.w3.org/2001/XMLSchema';
        var builder = new XmlBuilder(optimizeNamespaces: true);
        builder.element('schema', nest: () {
          builder.namespace(uri);
          builder.attribute('lang', 'en', namespace: uri);
          builder.element('element', namespace: uri);
        }, namespace: uri);
        var xml = builder.build();
        assertTreeInvariants(xml);
        var actual = xml.toString();
        var expected =
        '<schema xmlns="http://www.w3.org/2001/XMLSchema" lang="en">'
        '<element />'
        '</schema>';
        expect(actual, expected);
      });
      test('undefined namespace', () {
        var builder = new XmlBuilder(optimizeNamespaces: false);
        expect(() => builder.element('element', namespace: 'http://1.foo.com/'),
            throwsArgumentError);
      });
      test('undefined namespace optimized', () {
        var builder = new XmlBuilder(optimizeNamespaces: true);
        expect(() => builder.element('element', namespace: 'http://1.foo.com/'),
            throwsArgumentError);
      });
      test('invalid namespace', () {
        var builder = new XmlBuilder(optimizeNamespaces: false);
        builder.element('element', nest: () {
          expect(() => builder.namespace('http://1.foo.com/', 'xml'),
              throwsArgumentError);
  
negative.code:       var expected = '<element xmlns:foo="http://1.foo.com/" />';
        expect(actual, expected);
      });
      test('unused namespace (optimized)', () {
        var builder = new XmlBuilder(optimizeNamespaces: true);
        builder.element('element', nest: () {
          builder.namespace('http://1.foo.com/', 'foo');
  