internal static Node Create(IDOMNode Node)
 {
     if (Node is IDOMDocument)
     {
         return(Document.Create(Node as IDOMDocument));
     }
     else if (Node is IDOMAttr)
     {
         return(Attr.Create(Node as IDOMAttr));
     }
     else if (Node is IDOMCharacterData)
     {
         return(CharacterData.Create(Node as IDOMCharacterData));
     }
     else if (Node is IDOMElement)
     {
         return(Element.Create(Node as IDOMElement));
     }
     else if (Node is IDOMDocumentType)
     {
         return(DocumentType.Create(Node as IDOMDocumentType));
     }
     else if (Node is IDOMDocumentFragment)
     {
         return(DocumentFragment.Create(Node as IDOMDocumentFragment));
     }
     else if (Node is IDOMEntityReference)
     {
         return(EntityReference.Create(Node as IDOMEntityReference));
     }
     else if (Node is IDOMProcessingInstruction)
     {
         return(ProcessingInstruction.Create(Node as IDOMProcessingInstruction));
     }
     else
     {
         return(new Node(Node));
     }
 }
 /// <summary>
 /// Cretaes an attribute node with the specified name and namespace.
 /// </summary>
 /// <param name="NamespaceURI">Namespace name of the attribute.</param>
 /// <param name="Name">Name of the attribute.</param>
 /// <returns>The new attribute node.</returns>
 public Attr CreateAttributeNS(string NamespaceURI, string Name)
 {
     return(Attr.Create(document.createAttributeNS(NamespaceURI, Name)));
 }
 /// <summary>
 /// Creates an attribute node with the specified name.
 /// </summary>
 /// <param name="Name">Name of the attribute.</param>
 /// <returns>The new attribute node.</returns>
 public Attr CreateAttribute(string Name)
 {
     return(Attr.Create(document.createAttribute(Name)));
 }
 /// <summary>
 /// Adds a new attribute node.
 /// </summary>
 /// <param name="NewAttr">The attribute node to add.</param>
 /// <returns>The added node.</returns>
 public Attr SetAttributeNodeNS(Attr NewAttr)
 {
     return(Attr.Create(element.setAttributeNodeNS((IDOMAttr)NewAttr.GetWebKitObject())));
 }
 /// <summary>
 /// Removes the specified attribute.
 /// </summary>
 /// <param name="OldAttr">The attribute to remove.</param>
 /// <returns>The removed attribute.</returns>
 public Attr RemoveAttributeNode(Attr OldAttr)
 {
     return(Attr.Create(element.removeAttributeNode((IDOMAttr)OldAttr.GetWebKitObject())));
 }
 /// <summary>
 /// Gets the attribute node with the specified namespace and name.
 /// </summary>
 /// <param name="NamespaceURI">Namespace of the attribute.</param>
 /// <param name="LocalName">Name of the attribute.</param>
 /// <returns>Attr node.</returns>
 public Attr GetAttributeNodeNS(string NamespaceURI, string LocalName)
 {
     return(Attr.Create(element.getAttributeNodeNS(NamespaceURI, LocalName)));
 }
 /// <summary>
 /// Gets the attribute node with the specified name.
 /// </summary>
 /// <param name="Name">Name of the attribute.</param>
 /// <returns>Attr node.</returns>
 public Attr GetAttributeNode(string Name)
 {
     return(Attr.Create(element.getAttributeNode(Name)));
 }