log.trace("Parsing {}", xsElement);
final XSTypeDefinition typeDefinition = xsElement.getTypeDefinition();
switch (typeDefinition.getTypeCategory()) {
case SIMPLE_TYPE: {
final XSSimpleTypeDefinition simpleTypeDefinition = (XSSimpleTypeDefinition) typeDefinition;
return new Node(parent, new QName(xsElement.getNamespace(), xsElement.getName()), convert(simpleTypeDefinition));
}
case COMPLEX_TYPE: {
final XSComplexTypeDefinition complexTypeDefinition = (XSComplexTypeDefinition) typeDefinition;
final Node element = new Node(parent, new QName(xsElement.getNamespace(), xsElement.getName()), new HashSet<Node>(), new ArrayList<Node>());
final XSObjectList attributeUses = complexTypeDefinition.getAttributeUses();
for (final Object attributeObject : attributeUses) {
final XSAttributeUse attributeUse = (XSAttributeUse) attributeObject;
final XSAttributeDeclaration attributeDeclaration = attributeUse.getAttrDeclaration();
log.trace("Attribute {{}}{}", attributeDeclaration.getNamespace(), attributeDeclaration.getName());
final Node attribute = new Node(element, new QName(attributeDeclaration.getNamespace(), attributeDeclaration.getName()), convert(attributeDeclaration.getTypeDefinition()));
element.attributes.add(attribute);
}
final XSParticle particle = complexTypeDefinition.getParticle();
if (particle != null) {