/** @nowebref */ protected XML(XML parent, Node node) { this.node = node; this.parent = parent; for (String attr : parent.listAttributes()) { if (attr.startsWith("xmlns")) { // Copy namespace attributes to the kids, otherwise this XML // can no longer be printed (or manipulated in most ways). // Only do this when it's an Element, otherwise it's trying to set // attributes on text notes (interstitial content). if (node instanceof Element) { setString(attr, parent.getString(attr)); } } } }