code: public static XSDeclaration getXsdDeclaration(CPropertyInfo propertyInfo) {
  		XSComponent schemaComponent = propertyInfo.getSchemaComponent();
  
  		if (!(schemaComponent instanceof XSParticle)) {
  			// XSComplexType for example:
  			return null;
  		}
  
  		XSTerm term = ((XSParticle) schemaComponent).getTerm();
  
  		if (!(term instanceof XSDeclaration)) {
  			// XSModelGroup for example:
  			return null;
  		}
  
  		return (XSDeclaration) term;
  	}
docs: Returns XSD declaration of given property.