}
+string CalDAV::ProcessXMLEntryETag(){
+
+ string EntryETag;
+
+ xmlDocPtr xmlCalDAVDoc;
+ xmlCalDAVDoc = xmlReadMemory(ServerData.c_str(), (int)ServerData.size(), "noname.xml", NULL, 0);
+
+ xmlNodePtr NodeSeek;
+ bool NodeFound = false;
+
+ // Start with the first node, look for multistatus.
+
+ for (NodeSeek = xmlCalDAVDoc->children;
+ NodeSeek != NULL;
+ NodeSeek = NodeSeek->next)
+ {
+
+ if (!xmlStrcmp(NodeSeek->name, (const xmlChar *)"multistatus") ||
+ !xmlStrcmp(NodeSeek->name, (const xmlChar *)"d:multistatus") ||
+ !xmlStrcmp(NodeSeek->name, (const xmlChar *)"D:multistatus")
+ ){
+
+ NodeFound = true;
+ break;
+
+ }
+
+ }
+
+ // Look for response.
+
+ if (NodeFound == false){ return EntryETag; } else { NodeFound = false; }
+ NodeFound = MatchXMLNameTransverse(&NodeSeek, "response");
+
+ // Look for propstat.
+
+ if (NodeFound == false){ return EntryETag; } else { NodeFound = false; }
+ NodeFound = MatchXMLNameTransverse(&NodeSeek, "propstat");
+
+ // Look for prop.
+
+ if (NodeFound == false){ return EntryETag; } else { NodeFound = false; }
+ NodeFound = MatchXMLNameTransverse(&NodeSeek, "prop");
+
+ // Look for calendar-home-set.
+
+ if (NodeFound == false){ return EntryETag; } else { NodeFound = false; }
+ NodeFound = MatchXMLNameTransverse(&NodeSeek, "getetag");
+
+ // Get the data from href.
+
+ EntryETag = FetchXMLData(&NodeSeek);
+
+ xmlFreeDoc(xmlCalDAVDoc);
+
+ // Check if the entity tag contains quote marks
+ // at the start and end and remove them (if needed).
+
+ if (EntryETag.substr(0,1) == "\"" &&
+ EntryETag.substr(EntryETag.size()-1, 1) == "\"" && EntryETag.size() > 2){
+
+ EntryETag.erase(EntryETag.begin());
+ EntryETag.erase(EntryETag.end()-1);
+
+ }
+
+ return EntryETag;
+
+}
+
bool CalDAV::MatchXMLNameTransverse(xmlNodePtr *NodePtr, string NodeName){
string NodeNameSmallD = "d:" + NodeName;