In this example, we create an XML document with a root node and three child nodes. We then get the previous sibling of child3, which is child2. Example 2:c++ QDomDocument doc; QDomElement root = doc.createElement("root"); doc.appendChild(root); QDomText text1 = doc.createTextNode("Text 1"); root.appendChild(text1); QDomText text2 = doc.createTextNode("Text 2"); root.appendChild(text2); QDomNode sibling = text2.previousSibling(); // sibling is now text1 ``` In this example, we create an XML document with a root node and two text nodes. We then get the previous sibling of text2, which is text1. Package library: Qt Core Module.