anchor.diff:      if (prefix == _XMLNS || prefix == _XML) {
         throw new ArgumentError('The "$prefix" prefix cannot be bound.');
       }
  -    if (_stack.any((builder) => builder.namespaces[uri] != null && builder.namespaces[uri].prefix == prefix)) {
  -      // namespace prefix already correctly specified
  +    if (optimizeNamespaces && _stack.any(
  +        (builder) => builder.namespaces.containsKey(uri) &&
  +                     builder.namespaces[uri].prefix == prefix)) {
  +      // namespace prefix already correctly specified in an ancestor
         return;
       }
       if (_stack.last.namespaces.values.any((meta) => meta.prefix == prefix)) {
  
positive.code:         (builder) => builder.namespaces.containsKey(uri),
          orElse: () => throw new ArgumentError('Undefined namespace: $uri'));
      return builder.namespaces[uri];
    }
  
    // Internal method to mark a namespace as used
    void _useNamespace(String uri) {
      var builder = _stack.lastWhere(
          (builder) => builder.namespaces.containsKey(uri),
          orElse: () => throw new ArgumentError('Undefined namespace: $uri'));
      builder.namespaces[uri].use();
    }
  
    // Internal method to add children to the current element.
  
negative.code:   void attribute(String name, value, {String namespace}) {
      _stack.last.attributes
          .add(new XmlAttribute(_buildName(name, namespace), value.toString()));
    }
  
    /**
  