Index: /main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.py	(revision 5737)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.py	(revision 5738)
@@ -11,4 +11,8 @@
 def removeFileOrDirectory(filepath):
     """Remove a file or directory.
+
+    Different to :func:`shutil.rmtree` we also accept not existing
+    paths (returning silently) and if a dir turns out to be a regular
+    file, we remove that.
     """
     filepath = os.path.abspath(filepath)
@@ -76,8 +80,28 @@
 
     If there is no body, return as-is.
+
+    Let's see how that works. If we deliver some doc with form, we
+    will get that form only:
+
+       >>> doc = '<html><form>My Form</form>Outside the form</html>'
+       >>> getInnerHTMLPart(doc)
+       '<form>My Form</form>'
+
+    No form? Then seek for a body part and get the contents:
+
+       >>> doc = '<html><body>My Body</body>Trailing Trash</html>'
+       >>> getInnerHTMLPart(doc)
+       'My Body'
+
+    If none of these is included, return what we got:
+
+       >>> doc = '<html>without body nor form</html>'
+       >>> getInnerHTMLPart(doc)
+       '<html>without body nor form</html>'
+
     """
 
     try:
-        result = re.match('^.+(<forms[^\>]*>.*</form>).+$', html_code,
+        result = re.match('^.+(<form[^\>]*>.*</form>).+$', html_code,
                           re.DOTALL).groups()[0]
         return result
