Create a new node with a given _name_.
 Return an XML string representation of the node.
 It is shallow, not recursing into subnodes
359452
def to_xml
      xml = '<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
'
      each_pair do |k, _v|
        xml += "<node name=\"#{k}\" />"
      end
      if @object
        @object.intfs.each_pair do |_k, v|
          xml += %(<interface name="#{v.name}">\n)
          v.methods.each_value { |m| xml += m.to_xml }
          v.signals.each_value { |m| xml += m.to_xml }
          xml += "</interface>\n"
        end
      end
      xml += "</node>"
      xml
    end
800932
public Tree getNode(String name) {
    Tree tree = namesToNodes.get(name);
    return tree;
  }
1289887
def to_xml(params = {})
      params[:fields] ||= []
      params.reverse_merge!(:name => self.class.tag_name, :namespace => self.class.roxml_namespace)
      params[:namespace] = nil if ['*', 'xmlns'].include?(params[:namespace])
      node = XML.new_node([params[:namespace], params[:name]].compact.join(':')).tap do |root|
        refs = (self.roxml_references.present? \
          ? self.roxml_references \
          : self.class.roxml_attrs.map {|attr| attr.to_ref(self) })

        if params[:fields].length > 0
          refs.reject! { |r| !params[:fields].include?(r.name) }
        end
        refs.each do |ref|
          value = ref.to_xml(self)
          unless value.nil?
            ref.update_xml(root, value)
          end
        end
      end
    end
812833
@CheckForNull
    public Node getNode(String name) {
        return name == null ? null : nodes.get(name);
    }
317665
def create_node(self, name, project_id, node_id, *args, **kwargs):
        

        if node_id in self._nodes:
            return self._nodes[node_id]

        project = ProjectManager.instance().get_project(project_id)
        if node_id and isinstance(node_id, int):
            # old project
            with (yield from BaseManager._convert_lock):
                node_id = yield from self.convert_old_project(project, node_id, name)

        if not node_id:
            node_id = str(uuid4())

        node = self._NODE_CLASS(name, node_id, project, self, *args, **kwargs)
        if asyncio.iscoroutinefunction(node.create):
            yield from node.create()
        else:
            node.create()
        self._nodes[node.id] = node
        project.add_node(node)
        return node
980948
static Node newVarNode(String name, Node value) {
    Node lhs = IR.name(name);
    if (value != null) {
      lhs.srcref(value);
    }
    return newVarNode(lhs, value);
  }
274976
function XmlNode(name, children) {
    if (children === void 0) { children = []; }
    this.name = name;
    this.children = children;
    this.attributes = {};
}
101648
def node(self, content):
        
        ns = content.type.namespace()
        if content.type.form_qualified:
            node = Element(content.tag, ns=ns)
            if ns[0]:
                node.addPrefix(ns[0], ns[1])
        else:
            node = Element(content.tag)
        self.encode(node, content)
        log.debug("created - node:\n%s", node)
        return node
498631
public Xml getChild(String name)
    {
        Check.notNull(name);

        final NodeList list = root.getChildNodes();
        for (int i = 0; i < list.getLength(); i++)
        {
            final Node node = list.item(i);
            if (node instanceof Element && node.getNodeName().equals(name))
            {
                return new Xml(document, (Element) node);
            }
        }
        throw new LionEngineException(ERROR_NODE + name);
    }
25986
def __get_node_by_name(self, name):
        
        try:
            for entry in filter(lambda x: x.name == name, self.nodes()):
                return entry
        except StopIteration:
            raise ValueError("Attempted to retrieve a non-existing tree node with name: {name}"
                             "".format(name=name))
1283893
private String createXML(NodeConfig node) {
		class XMLCreator extends XmlMarshaller {
			public XMLCreator(NodeConfig node) {
				super(node);
			}

			public String print() {
				try {
					return super.marshal().toString();
				} catch (MarshalException e) {
					return "";
				}
			}
		}
		XMLCreator creator = new XMLCreator(node);
		return creator.print();
	}
700205
def get_node(self, node_name):
        """"""
        for node in self.nodes:
            if node.__name__ == node_name:
                return node
500285
def newDocRawNode(self, ns, name, content):
        
        if ns is None: ns__o = None
        else: ns__o = ns._o
        ret = libxml2mod.xmlNewDocRawNode(self._o, ns__o, name, content)
        if ret is None:raise treeError('xmlNewDocRawNode() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
58607
def append_minidom_xml_to_elementtree_xml(parent, xml, recursive=False, attributes=None):
    

    # Get the root tag name
    if recursive is False:
        tag_name = xml.documentElement.tagName
        node = xml.getElementsByTagName(tag_name)[0]
        new_elem = SubElement(parent, tag_name)
        if attributes:
            for attribute in attributes:
                if xml.documentElement.getAttribute(attribute):
                    new_elem.set(attribute, xml.documentElement.getAttribute(attribute))
    else:
        node = xml
        tag_name = node.tagName
        new_elem = parent

    i = 0
    for child_node in node.childNodes:
        if child_node.nodeName == '#text':
            if not new_elem.text and i <= 0:
                new_elem.text = child_node.nodeValue
            elif not new_elem.text and i > 0:
                new_elem_sub.tail = child_node.nodeValue
            else:
                new_elem_sub.tail = child_node.nodeValue

        elif child_node.childNodes is not None:
            new_elem_sub = SubElement(new_elem, child_node.tagName)
            new_elem_sub = append_minidom_xml_to_elementtree_xml(new_elem_sub, child_node,
                                                                 True, attributes)

        i = i + 1

    # Debug
    #encoding = 'utf-8'
    #rough_string = ElementTree.tostring(parent, encoding)
    #print rough_string

    return parent
418505
def copy(self, name: str) -> 'Selection':
        """"""
        return type(self)(name, copy.copy(self.nodes), copy.copy(self.elements))
1098819
def newCharRef(self, name):
        
        ret = libxml2mod.xmlNewCharRef(self._o, name)
        if ret is None:raise treeError('xmlNewCharRef() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
566792
def _create_xml_node(cls):
        
        try:
            xml_map = cls._xml_map
        except AttributeError:
            raise ValueError("This model has no XML definition")

        return _create_xml_node(
            xml_map.get('name', cls.__name__),
            xml_map.get("prefix", None),
            xml_map.get("ns", None)
        )