# Class: com.pnfsoftware.jeb.util.format.XmlBuilder

A specialized text builder used to craft XML documents sequentially.

## Constructor: XmlBuilder

Description: Create an XML builder with default indentation settings.

## Constructor: XmlBuilder
- parameter: `indentationSize`, type: `int`

Description: Create an XML builder.
parameter: indentationSize: number of spaces per indentation level

## Constructor: XmlBuilder
- parameter: `indentationSize`, type: `int`
- parameter: `initialCapacity`, type: `int`

Description: Create an XML builder.
parameter: indentationSize: number of spaces per indentation level
parameter: initialCapacity: initial capacity of the underlying character buffer

## Method: appendHeader
- parameter: `versionMajor`, type: `int`
- parameter: `versionMinor`, type: `int`
- parameter: `encoding`, type: `java.lang.String`
- parameter: `standalone`, type: `boolean`

Description: Append an XML header.
parameter: versionMajor: XML major version
parameter: versionMinor: XML minor version
parameter: encoding: declared character encoding
parameter: standalone: true to mark the document as standalone

## Method: appendStandardHeader

Description: Append a standard 1.0 header specifying a UTF\-8 encoding and standalone=no.

## Method: closeElement

Description: Close the last opened element.

## Method: closeElement
- parameter: `appendLine`, type: `boolean`

Description: Close the last opened element.
parameter: appendLine: if true, a new line is appended after the closing tag

## Method: openElement
- parameter: `name`, type: `java.lang.String`

Description: Output an XML element. The closing tag is not output.
parameter: name: the element name

## Method: openElement
- parameter: `name`, type: `java.lang.String`
- parameter: `attributes`, type: `java.util.Map<java.lang.String,java.lang.String>`

Description: Output an XML element with attributes. The closing tag is not output.
parameter: name: 
parameter: attributes: optional attributes

## Method: openElement
- parameter: `name`, type: `java.lang.String`
- parameter: `attributes`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `close`, type: `boolean`

Description: Output an XML element with attributes.
parameter: name: the element name
parameter: attributes: optional map of attributes name\-\>value, which must be escaped \(this method            will append the attributes' names and values as\-is\)
parameter: close: if true, the tag is immediately closed using "/\>"

## Static Method: escapeAll
- parameter: `s`, type: `java.lang.CharSequence`
- return type: `java.lang.CharSequence`

Description: Escape a string for XML text or attribute contexts.
parameter: s: string to escape
return: the escaped string

## Static Method: escapeAttributeData
- parameter: `s`, type: `java.lang.CharSequence`
- return type: `java.lang.CharSequence`

Description: Escape an XML attribute data string.
parameter: s: attribute data to escape
return: the escaped attribute data

## Static Method: escapeTextData
- parameter: `s`, type: `java.lang.CharSequence`
- return type: `java.lang.CharSequence`

Description: Escape an XML text data string.
parameter: s: text data to escape
return: the escaped text data

