}
writer.write(name.getLocalPart());
// Write namespace declarations.
Iterator nsIter = getNamespaces();
while (nsIter.hasNext()) {
Namespace ns = (Namespace) nsIter.next();
writer.write(' ');
ns.writeAsEncodedUnicode(writer);
}
// Write attributes
Iterator attrIter = getAttributes();
while (attrIter.hasNext()) {
Attribute attr = (Attribute) attrIter.next();