def getXMLLines(text):
 accumulatedOutput = None
 textLines = archive.getTextLines(text)
 combinedLines = []
 lastWord = '>'
 for textLine in textLines:
  strippedLine = textLine.strip()
  firstCharacter = None
  lastCharacter = None
  if (len(strippedLine) > 1):
   firstCharacter = strippedLine[0]
   lastCharacter = strippedLine[(-1)]
  if ((firstCharacter == '<') and (lastCharacter != '>') and (accumulatedOutput == None)):
   accumulatedOutput = cStringIO.StringIO()
   accumulatedOutput.write(textLine)
   if (strippedLine[:len('<!--')] == '<!--'):
    lastWord = '-->'
  elif (accumulatedOutput == None):
   addXMLLine(textLine, combinedLines)
  else:
   accumulatedOutput.write(('\n' + textLine))
   if (strippedLine[(- len(lastWord)):] == lastWord):
    addXMLLine(accumulatedOutput.getvalue(), combinedLines)
    accumulatedOutput = None
    lastWord = '>'
 xmlLines = []
 for combinedLine in combinedLines:
  xmlLines += getXMLTagSplitLines(combinedLine)
 return xmlLines

def getXMLLines ( text ) : accumulatedOutput = None textLines = archive . getTextLines ( text ) combinedLines = [ ] lastWord = '>' for textLine in textLines : strippedLine = textLine . strip ( ) firstCharacter = None lastCharacter = None if ( len ( strippedLine ) > 1 ) : firstCharacter = strippedLine [ 0 ] lastCharacter = strippedLine [ ( - 1 ) ] if ( ( firstCharacter == '<' ) and ( lastCharacter != '>' ) and ( accumulatedOutput == None ) ) : accumulatedOutput = cStringIO . StringIO ( ) accumulatedOutput . write ( textLine ) if ( strippedLine [ : len ( '<!--' ) ] == '<!--' ) : lastWord = '-->' elif ( accumulatedOutput == None ) : addXMLLine ( textLine , combinedLines ) else : accumulatedOutput . write ( ( '\n' + textLine ) ) if ( strippedLine [ ( - len ( lastWord ) ) : ] == lastWord ) : addXMLLine ( accumulatedOutput . getvalue ( ) , combinedLines ) accumulatedOutput = None lastWord = '>' xmlLines = [ ] for combinedLine in combinedLines : xmlLines += getXMLTagSplitLines ( combinedLine ) return xmlLines
get the all the xml lines of a text .