Index: branches/2.0-beta1/src/PacpusLib/XmlConfigFile.cpp
===================================================================
--- branches/2.0-beta1/src/PacpusLib/XmlConfigFile.cpp	(revision 147)
+++ branches/2.0-beta1/src/PacpusLib/XmlConfigFile.cpp	(revision 165)
@@ -28,7 +28,9 @@
 static const char * kConnectionSection = "connections";
 static const char * kParameterSection = "parameters";
+static const char * kPluginSection = "plugins";
 
 static const char * kComponentNode = "component";
 static const char * kConnectionNode = "connection";
+static const char * kParameterNode = "parameter";
 static const char * kPluginNode = "plugin";
 
@@ -55,4 +57,5 @@
     // create the sections
     m_document.documentElement().appendChild(m_document.createElement(kParameterSection));
+    m_document.documentElement().appendChild(m_document.createElement(kPluginSection));
     m_document.documentElement().appendChild(m_document.createElement(kComponentSection));
     m_document.documentElement().appendChild(m_document.createElement(kConnectionSection));
@@ -93,5 +96,5 @@
     (void) mutexLocker; // unused
 
-    // TODO: change .tagName => .attribute(kPropertyComponentName.c_str())
+    // TODO: change .tagName => .attribute(kPropertyComponentName)
     QDomNode componentSectionNode = getNamedItemFromDomDocument(m_document, kComponentSection);
     if (componentSectionNode.namedItem(component.attribute(kNameAttribute)/*.tagName()*/).isNull()) {
@@ -206,16 +209,25 @@
 }
 
+// XML
+QDomElement XmlConfigFile::getSection(const char * name) const
+{
+    QDomElement sectionElement = getNamedItemFromDomDocument(m_document, name).toElement();
+    if (sectionElement.isNull()) {
+        LOG_WARN("there is no '" << name << "' section in the XML");
+        return QDomElement();
+    }
+    return sectionElement;
+}
+
+QDomNodeList XmlConfigFile::getNodesInSection(const char * sectionName, const char * nodeName) const
+{
+    QDomElement sectionElement = getSection(sectionName);
+    return sectionElement.elementsByTagName(nodeName);
+}
+
 // COMPONENTS
 QDomNodeList XmlConfigFile::getAllComponents() const
 {
-    // get components section
-    QDomElement componentsElement = getNamedItemFromDomDocument(m_document, kComponentSection).toElement();
-    if (componentsElement.isNull()) {
-        LOG_WARN("there is no '" << kComponentSection << "' section in the XML");
-        return QDomNodeList();
-    }
-
-    // get component nodes
-    return componentsElement.elementsByTagName(kComponentNode);
+    return getNodesInSection(kComponentSection, kComponentNode);
 }
 
@@ -252,14 +264,5 @@
 QDomNodeList XmlConfigFile::getAllConnections() const
 {
-    // get connections section
-    QDomElement connectionsElement = getNamedItemFromDomDocument(m_document, kParameterSection).toElement();
-    if (connectionsElement.isNull()) {
-        LOG_WARN("there is no '" << kParameterSection << "' section in the XML");
-        return QDomNodeList();
-    }
-
-    // get connection nodes
-    //return connectionsElement.elementsByTagName(kConnectionNode);
-    return getNamedItemFromDomDocument(m_document, kConnectionSection).childNodes();
+    return getNodesInSection(kConnectionSection, kConnectionNode);
 }
 
@@ -281,16 +284,18 @@
 }
 
+// PARAMETERS
+QDomNodeList XmlConfigFile::getAllParameters() const
+{
+    return getNodesInSection(kParameterSection, kParameterNode);
+}
+
 // PLUGINS
 QDomNodeList XmlConfigFile::getAllPlugins()
 {
-    // get parameters section
-    QDomElement parametersElement = getNamedItemFromDomDocument(m_document, kParameterSection).toElement();
-    if (parametersElement.isNull()) {
-        LOG_WARN("there is no '" << kParameterSection << "' section in the XML");
-        return QDomNodeList();
-    }
+    // get section
+    QDomElement pluginsElement = getSection(kPluginSection);
 
     // get attributes
-    m_libraryExtension = parametersElement.attribute(kExtensionAttribute);
+    m_libraryExtension = pluginsElement.attribute(kExtensionAttribute);
     if (!m_libraryExtension.isEmpty()) {
         // prefix with a dot '.' if there is no one
@@ -299,9 +304,9 @@
         }
     }
-    m_libraryPrefix = parametersElement.attribute(kPrefixAttribute);
-    m_libraryPostfix = parametersElement.attribute(kPostfixAttribute);
+    m_libraryPrefix = pluginsElement.attribute(kPrefixAttribute);
+    m_libraryPostfix = pluginsElement.attribute(kPostfixAttribute);
     
-    // get plugin nodes
-    return parametersElement.elementsByTagName(kPluginNode);
+    // get nodes
+    return getNodesInSection(kPluginSection, kPluginNode);
 }
 
@@ -313,4 +318,5 @@
         return QStringList();
     }
+    LOG_INFO("there are " << pluginList.size() << " plugins");
 
     // get plugin library paths
