{
XMLOutputFactory factory = XMLOutputFactory.newInstance();
XMLStreamWriter sw = factory.createXMLStreamWriter(out, "UTF-8");
sw.writeStartDocument("UTF-8", "1.0");
sw.writeStartElement("D", "lockinfo", "DAV:");
sw.writeNamespace("D", "DAV:");
sw.writeStartElement("D", "lockscope", "DAV:");
if (isExclusive)
sw.writeEmptyElement("D", "exclusive", "DAV:");
else
sw.writeEmptyElement("D", "shared", "DAV:");