// Reformat
List<String> emptyTexts = new ArrayList<String>();
for (Object child : this.metadata.children()) {
if (child instanceof XmlElement) {
XmlElement element = (XmlElement) child;
for (XmlNamespace ns : element.namespaces()) {
// move the namespace declaration up if possible.
if (this.metadata.lookupNamespaceByPrefix(ns.getPrefix()) == null) {
// If this prefix is not used yet, copy to the root.
this.metadata.declareNamespace(ns);
}