groovy.xml

## Class XmlUtil

- java.lang.Object
- - groovy.xml.XmlUtil

-     public class XmlUtil
      extends Object

  Used for pretty printing XML content.
  Author:
    Paul King

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XmlUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `serialize(Element element)` Return a pretty String version of the Element.
    `static void` | `serialize(Element element, OutputStream os)` Write a pretty version of the Element to the OutputStream.
    `static void` | `serialize(Element element, Writer w)` Write a pretty version of the Element to the Writer.
    `static String` | `serialize(GPathResult node)` Return a pretty version of the GPathResult.
    `static void` | `serialize(GPathResult node, OutputStream os)` Write a pretty version of the GPathResult to the OutputStream.
    `static void` | `serialize(GPathResult node, Writer w)` Write a pretty version of the GPathResult to the Writer.
    `static String` | `serialize(Node node)` Return a pretty String version of the Node.
    `static void` | `serialize(Node node, OutputStream os)` Write a pretty version of the Node to the OutputStream.
    `static void` | `serialize(Node node, Writer w)` Write a pretty version of the Node to the Writer.
    `static String` | `serialize(String xmlString)` Return a pretty version of the XML content contained in the given String.
    `static void` | `serialize(String xmlString, OutputStream os)` Write a pretty version of the given XML string to the OutputStream.
    `static void` | `serialize(String xmlString, Writer w)` Write a pretty version of the given XML string to the Writer.
    `static String` | `serialize(Writable writable)` Return a pretty String version of the XML content produced by the Writable.
    `static void` | `serialize(Writable writable, OutputStream os)` Write a pretty version of the XML content produced by the Writable to the OutputStream.
    `static void` | `serialize(Writable writable, Writer w)` Write a pretty version of the XML content produced by the Writable to the Writer.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XmlUtil

          public XmlUtil()

  - ### Method Detail

    - #### serialize

          public static String serialize(Element element)

      Return a pretty String version of the Element.
      Parameters:
        `element` - the Element to serialize
      Returns:
        the pretty String representation of the Element

    - #### serialize

          public static void serialize(Element element,
                       OutputStream os)

      Write a pretty version of the Element to the OutputStream.
      Parameters:
        `element` - the Element to serialize
        `os` - the OutputStream to write to

    - #### serialize

          public static void serialize(Element element,
                       Writer w)

      Write a pretty version of the Element to the Writer.
      Parameters:
        `element` - the Element to serialize
        `w` - the Writer to write to

    - #### serialize

          public static String serialize(Node node)

      Return a pretty String version of the Node.
      Parameters:
        `node` - the Node to serialize
      Returns:
        the pretty String representation of the Node

    - #### serialize

          public static void serialize(Node node,
                       OutputStream os)

      Write a pretty version of the Node to the OutputStream.
      Parameters:
        `node` - the Node to serialize
        `os` - the OutputStream to write to

    - #### serialize

          public static void serialize(Node node,
                       Writer w)

      Write a pretty version of the Node to the Writer.
      Parameters:
        `node` - the Node to serialize
        `w` - the Writer to write to

    - #### serialize

          public static String serialize(GPathResult node)

      Return a pretty version of the GPathResult.
      Parameters:
        `node` - a GPathResult to serialize to a String
      Returns:
        the pretty String representation of the GPathResult

    - #### serialize

          public static void serialize(GPathResult node,
                       OutputStream os)

      Write a pretty version of the GPathResult to the OutputStream.
      Parameters:
        `node` - a GPathResult to serialize
        `os` - the OutputStream to write to

    - #### serialize

          public static void serialize(GPathResult node,
                       Writer w)

      Write a pretty version of the GPathResult to the Writer.
      Parameters:
        `node` - a GPathResult to serialize
        `w` - the Writer to write to

    - #### serialize

          public static String serialize(Writable writable)

      Return a pretty String version of the XML content produced by the Writable.
      Parameters:
        `writable` - the Writable to serialize
      Returns:
        the pretty String representation of the content from the Writable

    - #### serialize

          public static void serialize(Writable writable,
                       OutputStream os)

      Write a pretty version of the XML content produced by the Writable to the OutputStream.
      Parameters:
        `writable` - the Writable to serialize
        `os` - the OutputStream to write to

    - #### serialize

          public static void serialize(Writable writable,
                       Writer w)

      Write a pretty version of the XML content produced by the Writable to the Writer.
      Parameters:
        `writable` - the Writable to serialize
        `w` - the Writer to write to

    - #### serialize

          public static String serialize(String xmlString)

      Return a pretty version of the XML content contained in the given String.
      Parameters:
        `xmlString` - the String to serialize
      Returns:
        the pretty String representation of the original content

    - #### serialize

          public static void serialize(String xmlString,
                       OutputStream os)

      Write a pretty version of the given XML string to the OutputStream.
      Parameters:
        `xmlString` - the String to serialize
        `os` - the OutputStream to write to

    - #### serialize

          public static void serialize(String xmlString,
                       Writer w)

      Write a pretty version of the given XML string to the Writer.
      Parameters:
        `xmlString` - the String to serialize
        `w` - the Writer to write to