Index: /trunk/include/iprt/cpp/xml.h
===================================================================
--- /trunk/include/iprt/cpp/xml.h	(revision 49027)
+++ /trunk/include/iprt/cpp/xml.h	(revision 49028)
@@ -399,10 +399,10 @@
     const char *getPrefix() const;
     const char *getNamespaceURI() const;
-    bool nameEquals(const char *pcszNamespace, const char *pcsz) const;
+    bool nameEqualsNS(const char *pcszNamespace, const char *pcsz) const;
     bool nameEquals(const char *pcsz) const
     {
-        return nameEquals(NULL, pcsz);
-    }
-    bool nameEqualsN(const char *pcszNamespace, const char *pcsz, size_t cchMax) const;
+        return nameEqualsNS(NULL, pcsz);
+    }
+    bool nameEqualsN(const char *pcsz, size_t cchMax, const char *pcszNamespace = NULL) const;
 
     const char *getValue() const;
@@ -534,8 +534,4 @@
     AttributeNode(const AttributeNode &x);      // no copying
 
-    /** For storing attribute names with namespace prefix.
-     * Only used if with non-default namespace specified. */
-    RTCString    m_strKey;
-
     friend class Node;
     friend class ElementNode;
@@ -557,12 +553,10 @@
 {
 public:
-    int getChildElements(ElementNodesList &children,
-                         const char *pcszMatch = NULL) const;
-
-    const ElementNode *findChildElement(const char *pcszNamespace,
-                                        const char *pcszMatch) const;
+    int getChildElements(ElementNodesList &children, const char *pcszMatch = NULL) const;
+
+    const ElementNode *findChildElementNS(const char *pcszNamespace, const char *pcszMatch) const;
     const ElementNode *findChildElement(const char *pcszMatch) const
     {
-        return findChildElement(NULL, pcszMatch);
+        return findChildElementNS(NULL, pcszMatch);
     }
     const ElementNode *findChildElementFromId(const char *pcszId) const;
@@ -610,12 +604,15 @@
      *                              (default) match any namespace.  When using a
      *                              path, this matches all elements along the way.
+     * @param   pcszAttribNamespace The namespace prefix to apply to the attribute,
+     *                              NULL (default) match any namespace.
      * @see     findChildElementP and findAttributeValue
      */
     const char *findChildElementAttributeValueP(const char *pcszPath, const char *pcszAttribute,
-                                                const char *pcszPathNamespace = NULL) const
+                                                const char *pcszPathNamespace = NULL,
+                                                const char *pcszAttributeNamespace = NULL) const
     {
         const ElementNode *pElem = findChildElementP(pcszPath, pcszPathNamespace);
         if (pElem)
-            return pElem->findAttributeValue(pcszAttribute);
+            return pElem->findAttributeValue(pcszAttribute, pcszAttributeNamespace);
         return NULL;
     }
@@ -695,13 +692,15 @@
 
 
-    const AttributeNode *findAttribute(const char *pcszMatch) const;
+    const AttributeNode *findAttribute(const char *pcszMatch, const char *pcszNamespace = NULL) const;
     /** Find the first attribute with the given name, returning its value string.
      * @returns Pointer to the attribute string value.
      * @param   pcszName        The attribute name.
+     * @param   pcszNamespace   The namespace name, default is NULL which means
+     *                          anything goes.
      * @see getAttributeValue
      */
-    const char *findAttributeValue(const char *pcszName) const
-    {
-        const AttributeNode *pAttr = findAttribute(pcszName);
+    const char *findAttributeValue(const char *pcszName, const char *pcszNamespace = NULL) const
+    {
+        const AttributeNode *pAttr = findAttribute(pcszName, pcszNamespace);
         if (pAttr)
             return pAttr->getValue();
@@ -709,23 +708,31 @@
     }
 
-    bool getAttributeValue(const char *pcszMatch, const char *&pcsz) const  { return getAttributeValue(pcszMatch, &pcsz); }
-    bool getAttributeValue(const char *pcszMatch, RTCString &str) const;
-    bool getAttributeValuePath(const char *pcszMatch, RTCString &str) const;
-    bool getAttributeValue(const char *pcszMatch, int32_t &i) const;
-    bool getAttributeValue(const char *pcszMatch, uint32_t &i) const;
-    bool getAttributeValue(const char *pcszMatch, int64_t &i) const         { return getAttributeValue(pcszMatch, &i); }
-    bool getAttributeValue(const char *pcszMatch, uint64_t &i) const;
-    bool getAttributeValue(const char *pcszMatch, bool &f) const;
+    bool getAttributeValue(const char *pcszMatch, const char *&pcsz, const char *pcszNamespace = NULL) const
+    { return getAttributeValue(pcszMatch, &pcsz, pcszNamespace); }
+    bool getAttributeValue(const char *pcszMatch, RTCString &str, const char *pcszNamespace = NULL) const
+    { return getAttributeValue(pcszMatch, &str, pcszNamespace); }
+    bool getAttributeValuePath(const char *pcszMatch, RTCString &str, const char *pcszNamespace = NULL) const
+    { return getAttributeValue(pcszMatch, &str, pcszNamespace); }
+    bool getAttributeValue(const char *pcszMatch, int32_t &i, const char *pcszNamespace = NULL) const
+    { return getAttributeValue(pcszMatch, &i, pcszNamespace); }
+    bool getAttributeValue(const char *pcszMatch, uint32_t &i, const char *pcszNamespace = NULL) const
+    { return getAttributeValue(pcszMatch, &i, pcszNamespace); }
+    bool getAttributeValue(const char *pcszMatch, int64_t &i, const char *pcszNamespace = NULL) const
+    { return getAttributeValue(pcszMatch, &i, pcszNamespace); }
+    bool getAttributeValue(const char *pcszMatch, uint64_t &u, const char *pcszNamespace = NULL) const
+    { return getAttributeValue(pcszMatch, &u, pcszNamespace); }
+    bool getAttributeValue(const char *pcszMatch, bool &f, const char *pcszNamespace = NULL) const
+    { return getAttributeValue(pcszMatch, &f, pcszNamespace); }
 
     /** @name Variants that for clarity does not use references for output params.
      * @{ */
-    bool getAttributeValue(const char *pcszMatch, const char **ppcsz) const;
-    bool getAttributeValue(const char *pcszMatch, RTCString *pStr) const    { return getAttributeValue(pcszMatch, *pStr); }
-    bool getAttributeValuePath(const char *pcszMatch, RTCString *pStr) const { return getAttributeValuePath(pcszMatch, *pStr); }
-    bool getAttributeValue(const char *pcszMatch, int32_t *pi) const        { return getAttributeValue(pcszMatch, *pi); }
-    bool getAttributeValue(const char *pcszMatch, uint32_t *pu) const       { return getAttributeValue(pcszMatch, *pu); }
-    bool getAttributeValue(const char *pcszMatch, int64_t *piValue) const;
-    bool getAttributeValue(const char *pcszMatch, uint64_t *pu) const       { return getAttributeValue(pcszMatch, *pu); }
-    bool getAttributeValue(const char *pcszMatch, bool *pf) const           { return getAttributeValue(pcszMatch, *pf); }
+    bool getAttributeValue(const char *pcszMatch, const char **ppcsz, const char *pcszNamespace = NULL) const;
+    bool getAttributeValue(const char *pcszMatch, RTCString *pStr, const char *pcszNamespace = NULL) const;
+    bool getAttributeValuePath(const char *pcszMatch, RTCString *pStr, const char *pcszNamespace = NULL) const;
+    bool getAttributeValue(const char *pcszMatch, int32_t *pi, const char *pcszNamespace = NULL) const;
+    bool getAttributeValue(const char *pcszMatch, uint32_t *pu, const char *pcszNamespace = NULL) const;
+    bool getAttributeValue(const char *pcszMatch, int64_t *piValue, const char *pcszNamespace = NULL) const;
+    bool getAttributeValue(const char *pcszMatch, uint64_t *pu, const char *pcszNamespace = NULL) const;
+    bool getAttributeValue(const char *pcszMatch, bool *pf, const char *pcszNamespace = NULL) const;
     /** @} */
 
Index: /trunk/src/VBox/Main/xml/Settings.cpp
===================================================================
--- /trunk/src/VBox/Main/xml/Settings.cpp	(revision 49027)
+++ /trunk/src/VBox/Main/xml/Settings.cpp	(revision 49028)
@@ -493,7 +493,6 @@
             // <ExtraDataItem name="GUI/LastWindowPostion" value="97,88,981,858"/>
             Utf8Str strName, strValue;
-            if (    ((pelmExtraDataItem->getAttributeValue("name", strName)))
-                 && ((pelmExtraDataItem->getAttributeValue("value", strValue)))
-               )
+            if (   pelmExtraDataItem->getAttributeValue("name", strName)
+                && pelmExtraDataItem->getAttributeValue("value", strValue) )
                 map[strName] = strValue;
             else
@@ -521,7 +520,6 @@
         flt.action = USBDeviceFilterAction_Ignore;
         Utf8Str strAction;
-        if (    (pelmLevel4Child->getAttributeValue("name", flt.strName))
-             && (pelmLevel4Child->getAttributeValue("active", flt.fActive))
-           )
+        if (   pelmLevel4Child->getAttributeValue("name", flt.strName)
+            && pelmLevel4Child->getAttributeValue("active", flt.fActive))
         {
             if (!pelmLevel4Child->getAttributeValue("vendorId", flt.strVendorId))
@@ -576,5 +574,5 @@
     settings::Medium med;
     Utf8Str strUUID;
-    if (!(elmMedium.getAttributeValue("uuid", strUUID)))
+    if (!elmMedium.getAttributeValue("uuid", strUUID))
         throw ConfigFileError(this, &elmMedium, N_("Required %s/@uuid attribute is missing"), elmMedium.getName());
 
@@ -669,12 +667,12 @@
 
         if (med.strFormat.isEmpty())        // not set with 1.4 format above, or 1.4 Custom format?
-            if (!(elmMedium.getAttributeValue("format", med.strFormat)))
+            if (!elmMedium.getAttributeValue("format", med.strFormat))
                 throw ConfigFileError(this, &elmMedium, N_("Required %s/@format attribute is missing"), elmMedium.getName());
 
-        if (!(elmMedium.getAttributeValue("autoReset", med.fAutoReset)))
+        if (!elmMedium.getAttributeValue("autoReset", med.fAutoReset))
             med.fAutoReset = false;
 
         Utf8Str strType;
-        if ((elmMedium.getAttributeValue("type", strType)))
+        if (elmMedium.getAttributeValue("type", strType))
         {
             // pre-1.4 used lower case, so make this case-insensitive
@@ -701,5 +699,5 @@
         {
             // DVD and floppy images before 1.4 had "src" attribute instead of "location"
-            if (!(elmMedium.getAttributeValue("src", med.strLocation)))
+            if (!elmMedium.getAttributeValue("src", med.strLocation))
                 throw ConfigFileError(this, &elmMedium, N_("Required %s/@src attribute is missing"), elmMedium.getName());
 
@@ -707,5 +705,5 @@
         }
 
-        if (!(elmMedium.getAttributeValue("format", med.strFormat)))
+        if (!elmMedium.getAttributeValue("format", med.strFormat))
         {
             // DVD and floppy images before 1.11 had no format attribute. assign the default.
@@ -721,5 +719,5 @@
     if (fNeedsLocation)
         // current files and 1.4 CustomHardDisk elements must have a location attribute
-        if (!(elmMedium.getAttributeValue("location", med.strLocation)))
+        if (!elmMedium.getAttributeValue("location", med.strLocation))
             throw ConfigFileError(this, &elmMedium, N_("Required %s/@location attribute is missing"), elmMedium.getName());
 
@@ -745,7 +743,6 @@
         {
             Utf8Str strPropName, strPropValue;
-            if (    (pelmHDChild->getAttributeValue("name", strPropName))
-                 && (pelmHDChild->getAttributeValue("value", strPropValue))
-               )
+            if (   pelmHDChild->getAttributeValue("name", strPropName)
+                && pelmHDChild->getAttributeValue("value", strPropValue) )
                 med.properties[strPropName] = strPropValue;
             else
@@ -1302,7 +1299,6 @@
             MachineRegistryEntry mre;
             Utf8Str strUUID;
-            if (    ((pelmChild1->getAttributeValue("uuid", strUUID)))
-                 && ((pelmChild1->getAttributeValue("src", mre.strSettingsFile)))
-               )
+            if (   pelmChild1->getAttributeValue("uuid", strUUID)
+                && pelmChild1->getAttributeValue("src", mre.strSettingsFile) )
             {
                 parseUUID(mre.uuid, strUUID);
@@ -1328,11 +1324,10 @@
         {
             DHCPServer srv;
-            if (    (pelmServer->getAttributeValue("networkName", srv.strNetworkName))
-                 && (pelmServer->getAttributeValue("IPAddress", srv.strIPAddress))
-                    && (pelmServer->getAttributeValue("networkMask", srv.GlobalDhcpOptions[DhcpOpt_SubnetMask]))
-                 && (pelmServer->getAttributeValue("lowerIP", srv.strIPLower))
-                 && (pelmServer->getAttributeValue("upperIP", srv.strIPUpper))
-                 && (pelmServer->getAttributeValue("enabled", srv.fEnabled))
-               )
+            if (   pelmServer->getAttributeValue("networkName", srv.strNetworkName)
+                && pelmServer->getAttributeValue("IPAddress", srv.strIPAddress)
+                && pelmServer->getAttributeValue("networkMask", srv.GlobalDhcpOptions[DhcpOpt_SubnetMask])
+                && pelmServer->getAttributeValue("lowerIP", srv.strIPLower)
+                && pelmServer->getAttributeValue("upperIP", srv.strIPUpper)
+                && pelmServer->getAttributeValue("enabled", srv.fEnabled) )
             {
                 xml::NodesLoop nlOptions(*pelmServer, "Options");
@@ -1351,7 +1346,6 @@
                     uint32_t u32Slot;
                     cfg->getAttributeValue("vm-name", strVmName);
-                    cfg->getAttributeValue("slot", (uint32_t&)u32Slot);
-                    readDhcpOptions(srv.VmSlot2OptionsM[VmNameSlotKey(strVmName, u32Slot)],
-                                   *cfg);
+                    cfg->getAttributeValue("slot", u32Slot);
+                    readDhcpOptions(srv.VmSlot2OptionsM[VmNameSlotKey(strVmName, u32Slot)], *cfg);
                 }
                 llDhcpServers.push_back(srv);
@@ -1368,5 +1362,5 @@
     xml::NodesLoop nl2(options, "Option");
     const xml::ElementNode *opt;
-    while((opt = nl2.forAllNodes()))
+    while ((opt = nl2.forAllNodes()))
     {
         DhcpOpt_T OptName;
@@ -1379,6 +1373,5 @@
         opt->getAttributeValue("value", OptValue);
 
-        map.insert(
-          std::map<DhcpOpt_T, Utf8Str>::value_type(OptName, OptValue));
+        map.insert(std::map<DhcpOpt_T, Utf8Str>::value_type(OptName, OptValue));
     } /* end of forall("Option") */
 
@@ -1398,12 +1391,11 @@
         {
             NATNetwork net;
-            if (    (pelmNet->getAttributeValue("networkName", net.strNetworkName))
-                 && (pelmNet->getAttributeValue("enabled", net.fEnabled))
-                 && (pelmNet->getAttributeValue("network", net.strNetwork))
-                 && (pelmNet->getAttributeValue("ipv6", net.fIPv6))
-                 && (pelmNet->getAttributeValue("ipv6prefix", net.strIPv6Prefix))
-                 && (pelmNet->getAttributeValue("advertiseDefaultIPv6Route", net.fAdvertiseDefaultIPv6Route))
-                 && (pelmNet->getAttributeValue("needDhcp", net.fNeedDhcpServer))
-               )
+            if (   pelmNet->getAttributeValue("networkName", net.strNetworkName)
+                && pelmNet->getAttributeValue("enabled", net.fEnabled)
+                && pelmNet->getAttributeValue("network", net.strNetwork)
+                && pelmNet->getAttributeValue("ipv6", net.fIPv6)
+                && pelmNet->getAttributeValue("ipv6prefix", net.strIPv6Prefix)
+                && pelmNet->getAttributeValue("advertiseDefaultIPv6Route", net.fAdvertiseDefaultIPv6Route)
+                && pelmNet->getAttributeValue("needDhcp", net.fNeedDhcpServer) )
             {
                 pelmNet->getAttributeValue("loopback6", net.u32HostLoopback6Offset);
@@ -2379,6 +2371,6 @@
         readNATForwardRuleList(elmMode, nic.nat.llRules);
     }
-    else if (   (elmMode.nameEquals("HostInterface"))
-             || (elmMode.nameEquals("BridgedInterface")))
+    else if (   elmMode.nameEquals("HostInterface")
+             || elmMode.nameEquals("BridgedInterface"))
     {
         enmAttachmentType = NetworkAttachmentType_Bridged;
@@ -2414,7 +2406,6 @@
             {
                 Utf8Str strPropName, strPropValue;
-                if (    (pelmModeChild->getAttributeValue("name", strPropName))
-                     && (pelmModeChild->getAttributeValue("value", strPropValue))
-                   )
+                if (   pelmModeChild->getAttributeValue("name", strPropName)
+                    && pelmModeChild->getAttributeValue("value", strPropValue) )
                     nic.genericProperties[strPropName] = strPropValue;
                 else
@@ -2958,7 +2949,6 @@
                         /* <Property name="TCP/Ports" value="3000-3002"/> */
                         Utf8Str strName, strValue;
-                        if (    ((pelmProperty->getAttributeValue("name", strName)))
-                             && ((pelmProperty->getAttributeValue("value", strValue)))
-                           )
+                        if (   pelmProperty->getAttributeValue("name", strName)
+                            && pelmProperty->getAttributeValue("value", strValue))
                             hw.vrdeSettings.mapProperties[strName] = strValue;
                         else
@@ -3006,5 +2996,5 @@
             // legacy BIOS/IDEController (pre 1.7)
             if (    (m->sv < SettingsVersion_v1_7)
-                 && ((pelmBIOSChild = pelmHwChild->findChildElement("IDEController")))
+                 && (pelmBIOSChild = pelmHwChild->findChildElement("IDEController"))
                )
             {
@@ -3092,12 +3082,10 @@
                 readUSBDeviceFilters(*pelmUSBChild, hw.usbSettings.llDeviceFilters);
         }
-        else if (    (m->sv < SettingsVersion_v1_7)
-                  && (pelmHwChild->nameEquals("SATAController"))
-                )
+        else if (   m->sv < SettingsVersion_v1_7
+                 && pelmHwChild->nameEquals("SATAController"))
         {
             bool f;
-            if (    (pelmHwChild->getAttributeValue("enabled", f))
-                 && (f)
-               )
+            if (   pelmHwChild->getAttributeValue("enabled", f)
+                && f)
             {
                 StorageController sctl;
@@ -3116,13 +3104,13 @@
         {
             Utf8Str strLocalOrUTC;
-            machineUserData.fRTCUseUTC =    pelmHwChild->getAttributeValue("localOrUTC", strLocalOrUTC)
-                                         && strLocalOrUTC == "UTC";
-        }
-        else if (    (pelmHwChild->nameEquals("UART"))
-                  || (pelmHwChild->nameEquals("Uart"))      // used before 1.3
+            machineUserData.fRTCUseUTC = pelmHwChild->getAttributeValue("localOrUTC", strLocalOrUTC)
+                                      && strLocalOrUTC == "UTC";
+        }
+        else if (    pelmHwChild->nameEquals("UART")
+                  || pelmHwChild->nameEquals("Uart")      // used before 1.3
                 )
             readSerialPorts(*pelmHwChild, hw.llSerialPorts);
-        else if (    (pelmHwChild->nameEquals("LPT"))
-                  || (pelmHwChild->nameEquals("Lpt"))       // used before 1.3
+        else if (    pelmHwChild->nameEquals("LPT")
+                  || pelmHwChild->nameEquals("Lpt")       // used before 1.3
                 )
             readParallelPorts(*pelmHwChild, hw.llParallelPorts);
@@ -3226,5 +3214,7 @@
                 }
             }
-        }  else if (pelmHwChild->nameEquals("HostPci")) {
+        }
+        else if (pelmHwChild->nameEquals("HostPci"))
+        {
             const xml::ElementNode *pelmDevices;
 
@@ -3537,7 +3527,6 @@
             const xml::ElementNode *pDriveChild;
             Utf8Str strTmp;
-            if (    ((pDriveChild = pelmHwChild->findChildElement("Image")))
-                 && (pDriveChild->getAttributeValue("uuid", strTmp))
-               )
+            if (   (pDriveChild = pelmHwChild->findChildElement("Image")) != NULL
+                && pDriveChild->getAttributeValue("uuid", strTmp))
                 parseUUID(att.uuid, strTmp);
             else if ((pDriveChild = pelmHwChild->findChildElement("HostDrive")))
@@ -3567,7 +3556,6 @@
         {
             bool fEnabled;
-            if (    (pelmHwChild->getAttributeValue("enabled", fEnabled))
-                 && (fEnabled)
-               )
+            if (   pelmHwChild->getAttributeValue("enabled", fEnabled)
+                && fEnabled)
             {
                 // create a new floppy controller and attach a floppy "attached device"
@@ -3585,7 +3573,6 @@
                 const xml::ElementNode *pDriveChild;
                 Utf8Str strTmp;
-                if (    ((pDriveChild = pelmHwChild->findChildElement("Image")))
-                     && (pDriveChild->getAttributeValue("uuid", strTmp))
-                   )
+                if (   (pDriveChild = pelmHwChild->findChildElement("Image"))
+                    && pDriveChild->getAttributeValue("uuid", strTmp) )
                     parseUUID(att.uuid, strTmp);
                 else if ((pDriveChild = pelmHwChild->findChildElement("HostDrive")))
@@ -3734,11 +3721,9 @@
         if (pelmSnapshotChild->nameEquals("Description"))
             snap.strDescription = pelmSnapshotChild->getValue();
-        else if (    (m->sv < SettingsVersion_v1_7)
-                  && (pelmSnapshotChild->nameEquals("HardDiskAttachments"))
-                )
+        else if (   m->sv < SettingsVersion_v1_7
+                 && pelmSnapshotChild->nameEquals("HardDiskAttachments"))
             readHardDiskAttachments_pre1_7(*pelmSnapshotChild, snap.storage);
-        else if (    (m->sv >= SettingsVersion_v1_7)
-                  && (pelmSnapshotChild->nameEquals("StorageControllers"))
-                )
+        else if (   m->sv >= SettingsVersion_v1_7
+                 && pelmSnapshotChild->nameEquals("StorageControllers"))
             readStorageControllers(*pelmSnapshotChild, snap.storage);
         else if (pelmSnapshotChild->nameEquals("Snapshots"))
@@ -3837,7 +3822,6 @@
 {
     Utf8Str strUUID;
-    if (    (elmMachine.getAttributeValue("uuid", strUUID))
-         && (elmMachine.getAttributeValue("name", machineUserData.strName))
-       )
+    if (   elmMachine.getAttributeValue("uuid", strUUID)
+        && elmMachine.getAttributeValue("name", machineUserData.strName))
     {
         parseUUID(uuid, strUUID);
Index: /trunk/src/VBox/Main/xml/ovfreader.cpp
===================================================================
--- /trunk/src/VBox/Main/xml/ovfreader.cpp	(revision 49027)
+++ /trunk/src/VBox/Main/xml/ovfreader.cpp	(revision 49028)
@@ -91,5 +91,5 @@
     }
 
-    if ((pTypeAttr = pRootElem->findAttribute("xml:lang")))
+    if ((pTypeAttr = pRootElem->findAttribute("lang", "xml")))
     {
         pcszTypeAttr = pTypeAttr->getValue();
@@ -135,6 +135,6 @@
         const char *pcszTypeAttr = "";
         const xml::AttributeNode *pTypeAttr;
-        if (    ((pTypeAttr = pElem->findAttribute("xsi:type")))
-             || ((pTypeAttr = pElem->findAttribute("type")))
+        if (    (pTypeAttr = pElem->findAttribute("type", "xsi")) != NULL
+             || (pTypeAttr = pElem->findAttribute("type")) != NULL
            )
             pcszTypeAttr = pTypeAttr->getValue();
@@ -231,5 +231,5 @@
 
             // optional vbox:uuid attribute (if OVF was exported by VirtualBox != 3.2)
-            pelmDisk->getAttributeValue("vbox:uuid", d.uuidVbox);
+            pelmDisk->getAttributeValue("uuid", d.uuidVbox, "vbox");
 
             const char *pcszFileRef;
@@ -335,5 +335,5 @@
     // peek under the <VirtualSystem> node whether we have a <vbox:Machine> node;
     // that case case, the caller can completely ignore the OVF but only load the VBox machine XML
-    vsys.pelmVboxMachine = pelmVirtualSystem->findChildElement("vbox", "Machine");
+    vsys.pelmVboxMachine = pelmVirtualSystem->findChildElementNS("vbox", "Machine");
 
     // now look for real OVF
@@ -351,6 +351,6 @@
         {
             const xml::AttributeNode *pTypeAttr;
-            if (    ((pTypeAttr = pelmThis->findAttribute("type")))
-                 || ((pTypeAttr = pelmThis->findAttribute("xsi:type")))
+            if (    (pTypeAttr = pelmThis->findAttribute("type")) != NULL
+                 || (pTypeAttr = pelmThis->findAttribute("type", "xsi")) != NULL
                )
                 pcszTypeAttr = pTypeAttr->getValue();
@@ -813,6 +813,6 @@
 
             const xml::ElementNode *pelmVBoxOSType;
-            if ((pelmVBoxOSType = pelmThis->findChildElement("vbox",            // namespace
-                                                             "OSType")))        // element name
+            if ((pelmVBoxOSType = pelmThis->findChildElementNS("vbox",            // namespace
+                                                               "OSType")))        // element name
                 vsys.strTypeVbox = pelmVBoxOSType->getValue();
         }
Index: /trunk/src/VBox/Runtime/common/zip/xarvfs.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/zip/xarvfs.cpp	(revision 49027)
+++ /trunk/src/VBox/Runtime/common/zip/xarvfs.cpp	(revision 49028)
@@ -1926,5 +1926,5 @@
                     xml::ElementNode const *pTocElem  = NULL;
                     if (pRootElem && pRootElem->nameEquals("xar"))
-                        pTocElem = pRootElem ? pRootElem->findChildElement(NULL, "toc") : NULL;
+                        pTocElem = pRootElem ? pRootElem->findChildElement("toc") : NULL;
                     if (pTocElem)
                     {
Index: /trunk/src/VBox/Runtime/r3/xml.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/xml.cpp	(revision 49027)
+++ /trunk/src/VBox/Runtime/r3/xml.cpp	(revision 49028)
@@ -484,5 +484,5 @@
  * @return
  */
-bool Node::nameEquals(const char *pcszNamespace, const char *pcsz) const
+bool Node::nameEqualsNS(const char *pcszNamespace, const char *pcsz) const
 {
     if (m_pcszName == pcsz)
@@ -508,11 +508,11 @@
  * Variant of nameEquals that checks the namespace as well.
  *
- * @return  true if equal, false if not.
- * @param   pcszNamespace   The name space prefix or NULL.
+ * @returns true if equal, false if not.
  * @param   pcsz            The element name.
  * @param   cchMax          The maximum number of character from @a pcsz to
  *                          match.
- */
-bool Node::nameEqualsN(const char *pcszNamespace, const char *pcsz, size_t cchMax) const
+ * @param   pcszNamespace   The name space prefix or NULL (default).
+ */
+bool Node::nameEqualsN(const char *pcsz, size_t cchMax, const char *pcszNamespace /* = NULL*/) const
 {
     /* Match the name. */
@@ -793,5 +793,5 @@
  * @return
  */
-const ElementNode *ElementNode::findChildElement(const char *pcszNamespace, const char *pcszMatch) const
+const ElementNode *ElementNode::findChildElementNS(const char *pcszNamespace, const char *pcszMatch) const
 {
     Node *p;
@@ -801,5 +801,5 @@
         {
             ElementNode *pelm = static_cast<ElementNode*>(p);
-            if (pelm->nameEquals(pcszNamespace, pcszMatch))
+            if (pelm->nameEqualsNS(pcszNamespace, pcszMatch))
                 return pelm;
         }
@@ -834,5 +834,5 @@
     size_t cchThis = strchr(pcszPath, '/') - pcszPath;
     if (cchThis == (size_t)((const char *)0 - pcszPath))
-        return this->findChildElement(pcszNamespace, pcszPath);
+        return findChildElementNS(pcszNamespace, pcszPath);
 
     /** @todo Can be done without recursion as we have both sibling lists and parent
@@ -844,5 +844,5 @@
         {
             const ElementNode *pElm = static_cast<const ElementNode *>(p);
-            if (pElm->nameEqualsN(pcszNamespace, pcszPath, cchThis))
+            if (pElm->nameEqualsN(pcszPath, cchThis, pcszNamespace))
             {
                 pElm = findChildElementP(pcszPath + cchThis, pcszNamespace);
@@ -921,5 +921,5 @@
         {
             const ElementNode *pElem = static_cast<const ElementNode *>(pSibling);
-            if (pElem->nameEquals(pcszNamespace, pcszMatch))
+            if (pElem->nameEqualsNS(pcszNamespace, pcszMatch))
                 return pElem;
         }
@@ -940,5 +940,5 @@
         {
             const ElementNode *pElem = static_cast<const ElementNode *>(pSibling);
-            if (pElem->nameEquals(pcszNamespace, pcszMatch))
+            if (pElem->nameEqualsNS(pcszNamespace, pcszMatch))
                 return pElem;
         }
@@ -950,28 +950,13 @@
  * Looks up the given attribute node in this element's attribute map.
  *
- * With respect to namespaces, the internal attributes map stores namespace
- * prefixes with attribute names only if the attribute uses a non-default
- * namespace. As a result, the following rules apply:
- *
- *  -- To find attributes from a non-default namespace, pcszMatch must not
- *     be prefixed with a namespace.
- *
- *  -- To find attributes from the default namespace (or if the document does
- *     not use namespaces), pcszMatch must be prefixed with the namespace
- *     prefix and a colon.
- *
- * For example, if the document uses the "vbox:" namespace by default, you
- * must omit "vbox:" from pcszMatch to find such attributes, whether they
- * are specifed in the xml or not.
- *
- * @param pcszMatch
- * @return
- */
-const AttributeNode *ElementNode::findAttribute(const char *pcszMatch) const
+ * @param   pcszMatch       The name of the attribute to find.
+ * @param   pcszNamespace   The attribute name space prefix or NULL.
+ */
+const AttributeNode *ElementNode::findAttribute(const char *pcszMatch, const char *pcszNamespace /*= NULL*/) const
 {
     AttributeNode *p;
     RTListForEachCpp(&m_attributes, p, AttributeNode, m_listEntry)
     {
-        if (p->nameEquals(pcszMatch))
+        if (p->nameEqualsNS(pcszNamespace, pcszMatch))
             return p;
     }
@@ -983,12 +968,12 @@
  * name and returns its value as a string.
  *
- * @param   pcszMatch   Name of attribute to find (see findAttribute() for
- *                      namespace remarks).
- * @param   ppcsz       Where to return the attribute.
+ * @param   pcszMatch       Name of attribute to find.
+ * @param   ppcsz           Where to return the attribute.
+ * @param   pcszNamespace   The attribute name space prefix or NULL.
  * @returns Boolean success indicator.
  */
-bool ElementNode::getAttributeValue(const char *pcszMatch, const char **ppcsz) const
-{
-    const AttributeNode *pAttr = findAttribute(pcszMatch);
+bool ElementNode::getAttributeValue(const char *pcszMatch, const char **ppcsz, const char *pcszNamespace /*= NULL*/) const
+{
+    const AttributeNode *pAttr = findAttribute(pcszMatch, pcszNamespace);
     if (pAttr)
     {
@@ -1003,18 +988,18 @@
  * name and returns its value as a string.
  *
- * @param   pcszMatch   Name of attribute to find (see findAttribute() for
- *                      namespace remarks).
- * @param   rStr        Reference to the string object that should receive the
- *                      attribute value.
+ * @param   pcszMatch       Name of attribute to find.
+ * @param   pStr            Pointer to the string object that should receive the
+ *                          attribute value.
+ * @param   pcszNamespace   The attribute name space prefix or NULL.
  * @returns Boolean success indicator.
  *
  * @throws  Whatever the string class may throw on assignment.
  */
-bool ElementNode::getAttributeValue(const char *pcszMatch, RTCString &rStr) const
-{
-    const AttributeNode *pAttr = findAttribute(pcszMatch);
+bool ElementNode::getAttributeValue(const char *pcszMatch, RTCString *pStr, const char *pcszNamespace /*= NULL*/) const
+{
+    const AttributeNode *pAttr = findAttribute(pcszMatch, pcszNamespace);
     if (pAttr)
     {
-        rStr = pAttr->getValue();
+        *pStr = pAttr->getValue();
         return true;
     }
@@ -1026,13 +1011,16 @@
  * Like getAttributeValue (ministring variant), but makes sure that all backslashes
  * are converted to forward slashes.
- * @param pcszMatch
- * @param str
- * @return
- */
-bool ElementNode::getAttributeValuePath(const char *pcszMatch, RTCString &str) const
-{
-    if (getAttributeValue(pcszMatch, str))
-    {
-        str.findReplace('\\', '/');
+ *
+ * @param   pcszMatch       Name of attribute to find.
+ * @param   pStr            Pointer to the string object that should
+ *                          receive the attribute path value.
+ * @param   pcszNamespace   The attribute name space prefix or NULL.
+ * @returns Boolean success indicator.
+ */
+bool ElementNode::getAttributeValuePath(const char *pcszMatch, RTCString *pStr, const char *pcszNamespace /*= NULL*/) const
+{
+    if (getAttributeValue(pcszMatch, pStr, pcszNamespace))
+    {
+        pStr->findReplace('\\', '/');
         return true;
     }
@@ -1043,20 +1031,20 @@
 /**
  * Convenience method which attempts to find the attribute with the given
- * name and returns its value as a signed integer. This calls
- * RTStrToInt32Ex internally and will only output the integer if that
- * function returns no error.
- *
- * @param pcszMatch name of attribute to find (see findAttribute() for namespace remarks)
- * @param i out: attribute value; overwritten only if attribute was found
- * @return TRUE if attribute was found and str was thus updated.
- */
-bool ElementNode::getAttributeValue(const char *pcszMatch, int32_t &i) const
-{
-    const char *pcsz;
-    if (    (getAttributeValue(pcszMatch, pcsz))
-         && (VINF_SUCCESS == RTStrToInt32Ex(pcsz, NULL, 0, &i))
-       )
-        return true;
-
+ * name and returns its value as a signed 32-bit integer.
+ *
+ * @param   pcszMatch       Name of attribute to find.
+ * @param   piValue         Where to return the value.
+ * @param   pcszNamespace   The attribute name space prefix or NULL.
+ * @returns Boolean success indicator.
+ */
+bool ElementNode::getAttributeValue(const char *pcszMatch, int32_t *piValue, const char *pcszNamespace /*= NULL*/) const
+{
+    const char *pcsz = findAttributeValue(pcszMatch, pcszNamespace);
+    if (pcsz)
+    {
+        int rc = RTStrToInt32Ex(pcsz, NULL, 0, piValue);
+        if (rc == VINF_SUCCESS)
+            return true;
+    }
     return false;
 }
@@ -1064,20 +1052,20 @@
 /**
  * Convenience method which attempts to find the attribute with the given
- * name and returns its value as an unsigned integer.This calls
- * RTStrToUInt32Ex internally and will only output the integer if that
- * function returns no error.
- *
- * @param pcszMatch name of attribute to find (see findAttribute() for namespace remarks)
- * @param i out: attribute value; overwritten only if attribute was found
- * @return TRUE if attribute was found and str was thus updated.
- */
-bool ElementNode::getAttributeValue(const char *pcszMatch, uint32_t &i) const
-{
-    const char *pcsz;
-    if (    (getAttributeValue(pcszMatch, pcsz))
-         && (VINF_SUCCESS == RTStrToUInt32Ex(pcsz, NULL, 0, &i))
-       )
-        return true;
-
+ * name and returns its value as an unsigned 32-bit integer.
+ *
+ * @param   pcszMatch       Name of attribute to find.
+ * @param   puValue         Where to return the value.
+ * @param   pcszNamespace   The attribute name space prefix or NULL.
+ * @returns Boolean success indicator.
+ */
+bool ElementNode::getAttributeValue(const char *pcszMatch, uint32_t *puValue, const char *pcszNamespace /*= NULL*/) const
+{
+    const char *pcsz = findAttributeValue(pcszMatch, pcszNamespace);
+    if (pcsz)
+    {
+        int rc = RTStrToUInt32Ex(pcsz, NULL, 0, puValue);
+        if (rc == VINF_SUCCESS)
+            return true;
+    }
     return false;
 }
@@ -1085,16 +1073,14 @@
 /**
  * Convenience method which attempts to find the attribute with the given
- * name and returns its value as a signed long integer. This calls
- * RTStrToInt64Ex internally and will only output the integer if that
- * function returns no error.
- *
- * @param   pcszMatch   Name of attribute to find (see findAttribute() for
- *                      namespace remarks).
- * @param   i           Where to return the attribute value on success.
+ * name and returns its value as a signed 64-bit integer.
+ *
+ * @param   pcszMatch       Name of attribute to find.
+ * @param   piValue         Where to return the value.
+ * @param   pcszNamespace   The attribute name space prefix or NULL.
  * @returns Boolean success indicator.
  */
-bool ElementNode::getAttributeValue(const char *pcszMatch, int64_t *piValue) const
-{
-    const char *pcsz = findAttributeValue(pcszMatch);
+bool ElementNode::getAttributeValue(const char *pcszMatch, int64_t *piValue, const char *pcszNamespace /*= NULL*/) const
+{
+    const char *pcsz = findAttributeValue(pcszMatch, pcszNamespace);
     if (pcsz)
     {
@@ -1108,20 +1094,20 @@
 /**
  * Convenience method which attempts to find the attribute with the given
- * name and returns its value as an unsigned long integer.This calls
- * RTStrToUInt64Ex internally and will only output the integer if that
- * function returns no error.
- *
- * @param pcszMatch name of attribute to find (see findAttribute() for namespace remarks)
- * @param i out: attribute value; overwritten only if attribute was found
- * @return TRUE if attribute was found and str was thus updated.
- */
-bool ElementNode::getAttributeValue(const char *pcszMatch, uint64_t &i) const
-{
-    const char *pcsz;
-    if (    (getAttributeValue(pcszMatch, pcsz))
-         && (VINF_SUCCESS == RTStrToUInt64Ex(pcsz, NULL, 0, &i))
-       )
-        return true;
-
+ * name and returns its value as an unsigned 64-bit integer.
+ *
+ * @param   pcszMatch       Name of attribute to find.
+ * @param   puValue         Where to return the value.
+ * @param   pcszNamespace   The attribute name space prefix or NULL.
+ * @returns Boolean success indicator.
+ */
+bool ElementNode::getAttributeValue(const char *pcszMatch, uint64_t *puValue, const char *pcszNamespace /*= NULL*/) const
+{
+    const char *pcsz = findAttributeValue(pcszMatch, pcszNamespace);
+    if (pcsz)
+    {
+        int rc = RTStrToUInt64Ex(pcsz, NULL, 0, puValue);
+        if (rc == VINF_SUCCESS)
+            return true;
+    }
     return false;
 }
@@ -1132,12 +1118,13 @@
  * "yes", "no", "1" or "0" as valid values.
  *
- * @param pcszMatch name of attribute to find (see findAttribute() for namespace remarks)
- * @param f out: attribute value; overwritten only if attribute was found
- * @return TRUE if attribute was found and str was thus updated.
- */
-bool ElementNode::getAttributeValue(const char *pcszMatch, bool &f) const
-{
-    const char *pcsz;
-    if (getAttributeValue(pcszMatch, pcsz))
+ * @param   pcszMatch       Name of attribute to find.
+ * @param   pfValue         Where to return the value.
+ * @param   pcszNamespace   The attribute name space prefix or NULL.
+ * @returns Boolean success indicator.
+ */
+bool ElementNode::getAttributeValue(const char *pcszMatch, bool *pfValue, const char *pcszNamespace /*= NULL*/) const
+{
+    const char *pcsz = findAttributeValue(pcszMatch, pcszNamespace);
+    if (pcsz)
     {
         if (   !strcmp(pcsz, "true")
@@ -1146,5 +1133,5 @@
            )
         {
-            f = true;
+            *pfValue = true;
             return true;
         }
@@ -1154,5 +1141,5 @@
            )
         {
-            f = false;
+            *pfValue = false;
             return true;
         }
@@ -1483,13 +1470,4 @@
         m_pcszNamespacePrefix = (const char *)pLibAttr->ns->prefix;
         m_pcszNamespaceHref   = (const char *)pLibAttr->ns->href;
-
-        if (   !pElmRoot->m_pcszNamespaceHref
-            || strcmp(m_pcszNamespaceHref, pElmRoot->m_pcszNamespaceHref))
-        {
-            // not default namespace:
-            m_strKey = m_pcszNamespacePrefix;
-            m_strKey.append(':');
-            m_strKey.append(m_pcszName);
-        }
     }
 }
