Code example for XmlPullParserFactory

Methods: newSerializer

    private String nodeToNormalizedString(Node node)
            throws XmlPullParserException, IOException { 
        StringWriter writer = new StringWriter();
        XmlSerializer xmlSerializer = xmlPullParserFactory.newSerializer();
        xmlSerializer.setFeature("", true);
        emitNode(xmlSerializer, node);
        return writer.toString();
    private void emitNode(XmlSerializer serializer, Node node) throws IOException {
        if (node == null) {
            throw new UnsupportedOperationException("Cannot emit null nodes");
        } else if (node.getNodeType() == Node.ELEMENT_NODE) {
            Element element = (Element) node;
Connect your IDE to all the code out there  Get Codota for Java