code: static Document.OutputSettings outputSettings(Node node) {
          Document owner = node.ownerDocument();
          return owner != null ? owner.outputSettings() : (new Document("")).outputSettings();
      }
docs: Get the output setting for this node,  or if this node has no document (or parent), retrieve the default output
  settings