title: Error when appending a node of XmlNodeType::Attribute to an XmlNode
body: <p>Could someone please explain what I am doing here wrong that I get this error:</p>
  
  <pre><code>The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type.
  </code></pre>
  
  <p>on the last line in this code?</p>
  
  <pre><code>XmlDocument^ xmlDoc = gcnew XmlDocument();
  XmlNode^ xmlNode = xmlDoc-&gt;CreateNode(XmlNodeType::Element, "QualifyingProperties", "http://uri.etsi.org/01903/v1.3.2#");
  XmlNode^ nodAttribute = xmlDoc-&gt;CreateNode(XmlNodeType::Attribute, "Target", "http://namespace.123");
  
  xmlNode-&gt;AppendChild(nodAttribute);
  </code></pre>
  
  <p>What would be the correct way to add a node of XmlNodeType::Attribute type to an XmlNode?
  I'm aware I could create an XmlAttribute and add it to attributes, but I want to find out what's wrong with the way I was trying to do it.</p>