<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parseMemory(buffer, size):
 """parse an XML in-memory block and build a tree. """

    ret = libxml2mod.xmlParseMemory(buffer, size)
    if ret is None:raise parserError('xmlParseMemory() failed')
    return xmlDoc(_obj=ret)