question: private ParsedViewDetail deflate ( View view ) { ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; try { mViewHierarchy . deflate ( view , os ) ; DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder documentBuilder = factory . newDocumentBuilder ( ) ; Document doc = documentBuilder . parse ( new ByteArrayInputStream ( os . toByteArray ( ) ) ) ; Element root = ( Element ) doc . getFirstChild ( ) ; return convertToNode ( root ) ; } catch ( SAXException e ) { throw new RuntimeException ( e ) ; } catch ( ParserConfigurationException e ) { throw new RuntimeException ( e ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
target:  Deflates a view into an XML. Just to be clear though, this is only for debugging and it won't look anything like a real Android layout file.