code: @Override
      public void outputNamespaceDeclarations(XMLStreamWriter w) throws XMLStreamException
      {
          for (int i = 0, len = mNamespaces.size(); i < len; ++i) {
              Namespace ns = mNamespaces.get(i);
              if (ns.isDefaultNamespaceDeclaration()) {
                  w.writeDefaultNamespace(ns.getNamespaceURI());
              } else {
                  w.writeNamespace(ns.getPrefix(), ns.getNamespaceURI());
              }
          }
      }
docs: Method called by the matching start element class to
  output all namespace declarations active in current namespace
  scope, if any.