/**
* Parses a service document.
*/
private static ServiceDoc parseServiceDoc(XMLStreamReader parser) throws Exception {
ServiceDoc result = new ServiceDoc();
next(parser);
while (true) {
int event = parser.getEventType();
if (event == XMLStreamReader.START_ELEMENT) {
QName name = parser.getName();
if (Constants.NAMESPACE_APP.equals(name.getNamespaceURI())) {
if (TAG_WORKSPACE.equals(name.getLocalPart())) {
result.addWorkspace(parseWorkspace(parser));
} else {
skip(parser);
}
} else {
skip(parser);