def find_remarks_in_doc(doc,source)
     rems = doc.find('//db:remark')
     rems.map {|rem|
       c = rem.content.strip
       kw = STD_REMARK
       unless c.empty?
         kw1 = c.match('^([[:upper:]]+)([[:space:][:punct:]]|$)')
         unless kw1.nil?
           kw = kw1[1]
           c = kw1.post_match.lstrip
         end
       else
         c = EMPTY_REMARK
       end
       # TODO XPath integrieren? :path => rem.path, :parent => rem.parent.path,
       {:keyword => kw, :text => c, :file=>source, :line => rem.line_num}
     }
   end
def find_remarks_in_doc(doc,source)
     rems = doc.find('//db:remark')
     rems.map {|rem|
       c = rem.content.strip
       kw = STD_REMARK
       unless c.empty?
         kw1 = c.match('^([[:upper:]]+)([[:space:][:punct:]]|$)')
         unless kw1.nil?
           kw = kw1[1]
           c = kw1.post_match.lstrip
         end
       else
         c = EMPTY_REMARK
       end
       # TODO XPath integrieren? :path => rem.path, :parent => rem.parent.path,
       {:keyword => kw, :text => c, :file=>source, :line => rem.line_num}
     }
   end
Find all remark elements in the document and return a map for
 every such element. The map contains:

 * keyword: if the first word of the content is uppercase that is the keyword, else _REMARK_
 * text: the content of the remark element, minus the keyword
 * file: the name of the source file
 * line: the line number in the source file

 OPTIMIZE look for 'role' attributes as keywords?